SQLite have limited ALTER TABLE support so can use the add a column to the end of a TABLE or to change the name of a T Able. If you want to make more complex changes in the structure of a table, you'll have the table with to recreate. You can save existing data to a temporary table, drop the old table, create the new table, and then copy the data. The temporary table.
For example, suppose you has a table named "T1" with columns names "A", "B", and "C" and so you want to delete column " C "from this table. The following steps illustrate how this could is done:
BEGIN TRANSACTION; CREATE temporary table T1_backup (A, b), INSERT into T1_backup SELECT A, from t1;drop table T1; CREATE table T1 (A, b); INSERT into T1 SELECT A, from T1_backup;drop TABLE t1_backup; COMMIT;
Http://sqlite.org/faq.html#q11
Http://stackoverflow.com/questions/946011/sqlite-add-primary-key
SQLite does not support modifying the primary key after the table is built, or deleting the column, if you want to modify it, refer to the following procedure