Cannot remove or edit table columns

Issue #1 resolved
Dane Iracleous created an issue

Originally reported on Google Code with ID 1 ``` SQLite does not currently support editing or removing table columns, which means phpLiteAdmin does not support these features either. There is a potential workaround of creating a copy of the table with the desired column deleted/edited and then deleting the original table, but this hasn't been implemented yet.

```

Reported by `diracleo` on 2011-03-02 19:26:40

Comments (5)

  1. Dane Iracleous reporter

    ``` As an added note, SQLite2 is even more limited and does not allow any kind of altering of table structure. Columns cannot be added, deleted, or modified in any way. This limitation is handled with a polite explanation on the Structure tab of an SQLite2 database table that replaces the inputs and controls that would otherwise allow these features. ```

    Reported by `diracleo` on 2011-03-07 07:24:12

  2. Former user Account Deleted

    ``` Yeah, I had this same issue... My idea was going to be what you suggested, simply creating a new table with the added, removed and/or modified columns, copying over the data (this would need to be done very carefully, we don't want to lose any data... so for large tables the data would need to be copied over in segments), delete the old table, and rename the new one to that of the old one (which if I recall, SQLite v2 can do too).

    Not fun, but would be a great feature. ```

    Reported by `ian.aldrighetti` on 2011-03-07 22:02:14

  3. Dane Iracleous reporter

    ``` I just finished implementing this feature by checking each query as it comes in and treating it differently if it is an ALTER TABLE query. There is a huge, complicated function I took from the web that copies the table with the new fields and deletes the old one, etc.. it looks like it's working right but still needs more testing. It is commited in v1.4. ```

    Reported by `diracleo` on 2011-03-07 23:14:05

  4. Log in to comment