I have 2 tables: A and B. A has a foreign key to B and B has a foreign key to A. But I cannot make a foreign key from A to B, because A is created before B.
How can I solve it when SQLite doesn't support Alter Table?
This is my sample database:
Create Table A(
A_ID INTEGER PRIMARY KEY,
B_ID INTEGER,
A_DESCRIPTION TEXT,
FOREIGN KEY (B_ID) REFERENCES B(B_ID)
)
Create Table B(
B_ID INTEGER PRIMARY KEY,
A_ID INTEGER,
B_DESCRIPTION TEXT,
FOREIGN KEY (A_ID) REFERENCES A(A_ID)
)