SyuTingSong / phpliteadmin

Automatically exported from code.google.com/p/phpliteadmin
0 stars 0 forks source link

Add new column after some other (not at the end) #247

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Implement a workaround for ALTER TABLE ADD COLUMN AFTER.

This is more or less an extension to our ALTER TABLE workaround, which are 
mostly issue #12

Original issue reported on code.google.com by crazy4ch...@gmail.com on 9 Apr 2014 at 2:46

GoogleCodeExporter commented 9 years ago
In reaction to Chris' note here 
https://groups.google.com/forum/#!topic/phpliteadmin/029UzDxGMyQ

I would suggest something using current features: i.e:

myTable (columns A,B,C,D), add column X after B:

1: add column X
2: add columns _C,_D
3: copy contents: C->_C, D->_D
4: delete columns C,D
5: rename columns: _C->C, _D->D

Would it be easier?

Original comment by jan.turo...@gmail.com on 13 Apr 2014 at 12:02

GoogleCodeExporter commented 9 years ago
Good idea. But as we already have the mechanism to edit columns and add columns 
at the end, adding one in the middle is more or less simply a mixture of both 
from a technical point of view so it should not be too difficult to implement.

Original comment by crazy4ch...@gmail.com on 13 Apr 2014 at 8:45