datanucleus-rdbms icon indicating copy to clipboard operation
datanucleus-rdbms copied to clipboard

Support definition of foreign keys in CREATE TABLE statement

Open andyjefferson opened this issue 8 years ago • 0 comments

Some RDBMS allow specification of FOREIGN KEYs at the end of a CREATE TABLE statement. We should allow it.

CREATE TABLE TBL1 ( ID INT NOT NULL, COL1 INT, FOREIGN KEY (COL1) REFERENCES TBL2 (COLX) )

The complication is that the related table needs to exist, so need to introduce ordering into table creation whereas without this we don't (and just send the CREATE FK statement when both tables exist)

andyjefferson avatar Apr 11 '16 08:04 andyjefferson