0
0
mirror of https://github.com/tursodatabase/libsql.git synced 2025-08-04 00:10:32 +00:00
Files
libsql/libsql-sqlite3/test/fixtures/alterqf.test
2024-05-27 12:59:10 +02:00

19 lines
446 B
Plaintext

CREATE TABLE t1(a, b, c);
CREATE TABLE x1(
one, two, three, PRIMARY KEY(one),
CHECK (three!="xyz"), CHECK (two!="one")
) WITHOUT ROWID;
CREATE INDEX x1i ON x1(one+"two"+"four") WHERE "five";
CREATE TEMP TRIGGER AFTER INSERT ON x1 BEGIN
UPDATE x1 SET two=new.three || "new" WHERE one=new.one||"";
END;
ALTER TABLE x1 RENAME two TO 'four';
SELECT sql FROM sqlite_schema;
SELECT sql FROM sqlite_temp_schema;