-
Notifications
You must be signed in to change notification settings - Fork 607
Open
Milestone
Description
This issue is also the same as #3882, but the immediate fix isn't the same. In this case, we should support adding a FK (in the other it's a currently-unsupported feature).
Turso:
turso> create table t(a);
create table s(a);
alter table s add column b references t(a);
select * from sqlite_schema;
┌───────┬──────┬──────────┬──────────┬───────────────────────┐
│ type │ name │ tbl_name │ rootpage │ sql │
├───────┼──────┼──────────┼──────────┼───────────────────────┤
│ table │ t │ t │ 2 │ CREATE TABLE t (a) │
├───────┼──────┼──────────┼──────────┼───────────────────────┤
│ table │ s │ s │ 3 │ CREATE TABLE s (a, b) │
└───────┴──────┴──────────┴──────────┴───────────────────────┘
SQLite:
sqlite> create table t(a);
sqlite> create table s(a);
sqlite> alter table s add column b references t(a);
sqlite> select * from sqlite_schema;
table|t|t|2|CREATE TABLE t(a)
table|s|s|3|CREATE TABLE s(a, b references t(a))
Metadata
Metadata
Assignees
Labels
No labels