[ic] Adding fields using mysql

Ed LaFrance interchange-users@interchange.redhat.com
Tue Sep 18 13:44:01 2001


At 10:25 AM 09/18/2001 -0700, you wrote:
>At 05:28 PM 09/18/2001 +0200, you wrote:
>>"Zack Johnson" <zack@office.standardprinting.net> writes:
>>
>> > I added a field to dbconf/mysql/userdb.mysql:
>> >
>> > Database  userdb  COLUMN_DEF   "list TEXT NOT NULL"
>> >
>> > However, when I restart IC, the field is not added to the database.  Under
>> > Admin > table information > userdb, 'list' comes up under COLUMN_DEF, but
>> > not name.
>> >
>> > I'm lost on this one.  I checked through the IC Docs/mail archives, 
>> but most
>> > of everything seems focused on products, not tables in general.
>>
>>Hm, maybe IC considers these line only when the table doesn't already
>>exist ?
>>
>>Ciao
>>         Racke
>
>This is my procedure for adding columns to tables when using MySQL:
>
>1. Export the table in question via the UI.
>
>2. Add the additional column(s) to the resulting tablename.txt file.  For 
>a single column I usually do this in a shell session by inserting an extra 
>tab at the end of each row (in the products directory):
>
>perl -i -p -e 's/\n/\t\n/g' tablename.txt
>
>...then I edit the file, typing the new column name at the end of the 
>first (header) row.
>
>3. Delete the tablename.sql file.
>
>4. edit CATROOT/dbconf/mysql/tablename.mysql, adding the new column 
>definition.  BTW - be careful with text editors that automatically create 
>backup copies of files - delete any backup copies that appear in this 
>directory!
>
>5. Reconfigure the catalog (or restart IC, either will do the job).

... and as Mike H. pointed out, if you are working on a live catalog, you 
would want to take it offline to do it this way.

- Ed L.



===============================================================
New Media E.M.S.               Software Solutions for Business
463 Main St., Suite D          eCommerce | Consulting | Hosting
Placerville, CA  95667         edl@newmediaems.com
(530) 622-9421                 http://www.newmediaems.com
(866) 519-4680 Toll-Free       (530) 622-9426 Fax
===============================================================