Add reference from etype table's eid column to the entities table
Related to #4846892.
--- a/server/schema2sql.py Fri Jan 16 14:30:55 2015 +0100
+++ b/server/schema2sql.py Thu Jan 15 18:53:45 2015 +0100
@@ -156,7 +156,7 @@
# this is expected for NOW / TODAY
if creating:
if rdef.uid:
- sqltype += ' PRIMARY KEY'
+ sqltype += ' PRIMARY KEY REFERENCES entities (eid)'
elif rdef.cardinality[0] == '1':
# don't set NOT NULL if backend isn't able to change it later
if dbhelper.alter_column_support:
--- a/server/test/unittest_schema2sql.py Fri Jan 16 14:30:55 2015 +0100
+++ b/server/test/unittest_schema2sql.py Thu Jan 15 18:53:45 2015 +0100
@@ -130,7 +130,7 @@
);
CREATE TABLE State(
- eid integer PRIMARY KEY,
+ eid integer PRIMARY KEY REFERENCES entities (eid),
name varchar(256) NOT NULL,
description text
);