Ok, so here is the code that I’m trying to execute.
begin transaction;
SELECT [version] as ver FROM [dbinfo];
WHEN ver = 1 THEN
UPDATE [dbinfo] SET [version]=2;
ver = 2;
ALTER TABLE [cards] ADD COLUMN [alternate] TEXT NOT NULL;
END
WHEN ver = 2 THEN
UPDATE [dbinfo] SET [version]=3;
ver = 3;
ALTER TABLE [cards] ADD COLUMN [dependent] TEXT NOT NULL;
ALTER TABLE [cards] ADD COLUMN [mutable] BOOLEAN;
END
commit transaction;
Doesn’t work. Gets stuck on WHEN. I’ve tried also CASE WHEN, and a couple other various methods.
I need to step through ver by ver with this, so any ideas on how to make something like this work for Sqlite?
Thanks.
Can’t be done. Have to use workarounds using transactions and stuff.