[turba] upgrade problems

Ian Sealy horde-turba at iansealy.com
Tue Jul 4 07:55:18 PDT 2006


Dear Howard,

> There is one small issue. Now my database has the same fields as the 
> current version, but they are in different order. Does anyone know if 
> this matters? It is possible to write SQL that assumes the fields are 
> in a specific order, but that is not good programming practice. Still, 
> I wouldn't want to get burned.
> 
> For example, one could write something like
> 
> INSERT INTO turba.objects VALUES (data1, data1, data2, data3)
> 
> This assumes the files are ordered in the database in a certain way. A 
> better way to write this code would be
> 
> INSERT INTO turba.objects (column1, column1, column3, column4) VALUES 
> (data1, data2, data3, data4)
> 
> I could reorder the fields with some more awk programming, if I had 
> to. It is work I'd rather avoid it possible. Does the turba 
> development team review these kinds of coding issues?
> 
> Anyone have any thoughts on this?

If you're using MySQL 4.0 or later (I think) then you should just be 
able to change the column order using:

ALTER TABLE table CHANGE COLUMN column column blah AFTER column;

See:

   http://dev.mysql.com/doc/refman/4.1/en/alter-table.html

Cheers,
Ian


More information about the turba mailing list