equal
deleted
inserted
replaced
154 sqltype += ' DEFAULT %s' % default |
154 sqltype += ' DEFAULT %s' % default |
155 # XXX ignore default for other type |
155 # XXX ignore default for other type |
156 # this is expected for NOW / TODAY |
156 # this is expected for NOW / TODAY |
157 if creating: |
157 if creating: |
158 if rdef.uid: |
158 if rdef.uid: |
159 sqltype += ' PRIMARY KEY' |
159 sqltype += ' PRIMARY KEY REFERENCES entities (eid)' |
160 elif rdef.cardinality[0] == '1': |
160 elif rdef.cardinality[0] == '1': |
161 # don't set NOT NULL if backend isn't able to change it later |
161 # don't set NOT NULL if backend isn't able to change it later |
162 if dbhelper.alter_column_support: |
162 if dbhelper.alter_column_support: |
163 sqltype += ' NOT NULL' |
163 sqltype += ' NOT NULL' |
164 # else we're getting sql type to alter a column, we don't want key / indexes |
164 # else we're getting sql type to alter a column, we don't want key / indexes |