SQLite supports renaming tables, so in my experience you move the old table out of the way, and create the new table with the desired schema and the original name.
On Tue, May 22, 2018 at 2:34 PM, Igor Korot <ikoro...@gmail.com> wrote: > Hi, Charles, > > On Tue, May 22, 2018 at 2:30 PM, Charles Leifer <colei...@gmail.com> > wrote: > > As a workaround, you can always rename the existing table, create the new > > table with desired attributes, and do a INSERT INTO ... SELECT FROM > > old_table. Then you can safely drop the old table. > > But the table_name will be different. > Also the data in the old table might be referencing some other table. > So this process is not really very > straightforward... > > Thank you. > > > > > On Tue, May 22, 2018 at 1:14 PM, Thomas Kurz <sqlite.2...@t-net.ruhr> > wrote: > > > >> > ALTER TABLE ADD COLUMN has existed for a long time. > >> > >> Yes, sorry, I mixed things up. > >> > >> The order of importance is imho: > >> 1. RENAME COLUMN (shouldn't be too hard) > >> 2. DROP COLUMN (should be a bit more comlicated but feasible) > >> 3. MODIFY COLUMN > >> > >> > What kind of MODIFY COLUMN changes do you have in mind? > >> > >> I understand this can be difficult as there are many possible operations > >> that might be incompatible with the data already stored in that column. > >> Last time I needed MODIFY, I wanted to change the ON UPDATE/DELETE > CASCADE > >> action of a foreign key column. Also adding/removing a foreign key > would be > >> useful. > >> > >> Kind regards, > >> Thomas > >> > >> _______________________________________________ > >> sqlite-users mailing list > >> sqlite-users@mailinglists.sqlite.org > >> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > >> > > _______________________________________________ > > sqlite-users mailing list > > sqlite-users@mailinglists.sqlite.org > > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users