[ic] customizing IC's default SQL database tables

Dan B interchange-users@lists.akopia.com
Thu May 17 00:00:01 2001


At 08:48 PM 5/16/2001 -0700, you wrote:
>I'm attempting to customize Interchange to fit my needs - namely adding
>fields in the products and userdb database tables - and am having poor
>luck. I'm using Postgresql-7.x on a Red Hat 6.2 machine.
>
>I've been using the "construct" store template to make my database
>changes on, but I'm confused about what I need to edit to make the
>changes and have Interchange register them and still work.
>
>Is this the best way to go about setting up Interchange to work with a
>customized database setup?
>
>If so, what files should I be editing?
>
>I tried changing, relative to construct's root, /dbconf/pgsql/*.pgsql,
>but wasn't successful with that. Then I tried to make a file with the
>plain SQL statements for the creation of the database, and scratched
>the .pgsql files altogether. I've also edited the /products/*.txt files
>to match my customized database definitions. I then loaded my sql to
>postgres, but when I tried to load interchange it dies with an error in
>the configuration. Here is the exact error message when I entered
>"interchange -i":

[spurious error messages deleted]

Try this:

1. start with default template construct
2. add one field to database
         psql -c "ALTER TABLE products ADD COLUMN foo VARCHAR(64);"
3. add said field to dbconf/pgsql/products.pgsql
4. make sure you're not importing from text db
         touch products/products.sql
5. restart interchange

You can often skip step 2 if you replace step 4 with "add another column to 
products/products.txt".

HTH,

Dan Browning, Cyclone Computer Systems, danb@cyclonecomputers.com