Raise a dialog for table changing. This dialog looks quite similar like that "Create Table" one except a few things:
Sqlite ALTER TABLE command is very limited so there is no DROP COLUMN clause etc. Sqliteman handles custom ALTER TABLE with a workaround. It's strongly recommended to backup your data before dropping columns. You can lost indexes or invalidate triggers if you're not careful enough.
In this dialog you can
and table columns and set the options for new ones.
Remember triggers and indexes from the original table
Rename the original table with temporary name
Create new table with original name containing new column structure
Perform INSERT INTO original SELECT FROM temporary
Drop temporary table
Try to recreate original indexes and triggers
When there is no request for column dropping only the ALTER TABLE ADD COLUMN is performed.
A sample log output from add one column and remove on too in one batch. You can see two failed index recreation due missing column (that dropped one):
Example 7.1. Full Alter Table Example
Rename original table to _alter0_tags Creating new table: tags Begin Transaction Data Transfer Transaction Commit Dropping original table _alter0_tags Recreating original index/trigger Recreating original index/trigger Recreating original index/trigger Recreating original index/trigger Recreating original index/trigger Recreating original index/trigger Recreating original index/trigger Recreating original index/trigger Recreating original index/trigger (failed) table tags has no column named deviceid: CREATE INDEX tags_deviceid_index ON tags( deviceid ) Recreating original index/trigger (failed) table tags has no column named deviceid: CREATE UNIQUE INDEX url_tag ON tags( url, deviceid ) Columns added successfully Alter Table Done