diff -r 1443fe643a38 -r f8ccae1e271d server/schema2sql.py --- 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: