Hello !
I'm using sqlite3 for a long time and I used to be able to drop tables
that have views without error before but now it seems that it is not
possible anymore.
I mainly use it to restructure tables (add/move/remove fields) with
something like this:
====
PRAGMA foreign_keys=OFF;
BEGIN;
CREATE TABLE "banks___new"(
id integer primary key,
account_id integer references ledger_accounts(id),
name varchar not null collate nocase unique,
new_field integer, -------------- for example here I'm adding a new
field
notes text collate nocase
);
INSERT INTO "banks___new"(
"id",
"account_id",
"name",
"notes"
)
SELECT
"id",
"account_id",
"name",
"notes"
FROM "banks";
DROP TABLE "banks";
ALTER TABLE "banks___new" RENAME TO "banks";
PRAGMA foreign_key_check;
COMMIT;
PRAGMA foreign_keys=ON;
====
As I said before it use to work in previous versions of sqlite3 but now
it seems to not allow to drop tables that has views on then.
How can something like the above be achieved now without need to drop
and recreate the views (can be several views), any new pragma that I'm
not aware off ?
Cheers !
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users