I noticed that on sq_ast_lnk there is a uniqueness constraint over majorid, minorid, link_type and value. That would make perfect sense except that in postgres (maybe other sqls, I haven’t tried/checked) it’s not possible to be unique with a null value.
I probably haven’t explained that well so here’s an example, with the current db setup
INSERT into sq_ast_lnk (linkid,majorid,minorid,link_type,value,sort_order,is_dependant,is_exclusive,updated,updated_userwill complain about the uniqueness constraint where as
d)
VALUES (NEXTVAL(‘sq_ast_lnk_seq’),‘20007’,‘20008’,‘2’,’’,‘1’,‘1’,‘1’,‘2008-01-31 11:47:08’,‘12’);
INSERT into sq_ast_lnk (linkid,majorid,minorid,link_type,value,sort_order,is_dependant,is_exclusive,updated,updated_user
d)
VALUES (NEXTVAL(‘sq_ast_lnk_seq’),‘20007’,‘20008’,‘2’,’’,‘1’,‘1’,‘1’,‘2008-01-31 11:47:08’,‘12’);
INSERT into sq_ast_lnk (linkid,majorid,minorid,link_type,value,sort_order,is_dependant,is_exclusive,updated,updated_usermost of the time this probably isn’t that big a deal, but it is possible to have 1 div existing multiple times under a bodycopy (although probably only by hacking at the database directly, which would be bad wouldn’t it…).
d)
VALUES (NEXTVAL(‘sq_ast_lnk_seq’),‘20007’,‘20008’,‘2’,null,‘1’,‘1’,‘1’,‘2008-01-31 11:47:08’,‘12’);
INSERT into sq_ast_lnk (linkid,majorid,minorid,link_type,value,sort_order,is_dependant,is_exclusive,updated,updated_user
d)
VALUES (NEXTVAL(‘sq_ast_lnk_seq’),‘20007’,‘20008’,‘2’,null,‘1’,‘1’,‘1’,‘2008-01-31 11:47:08’,‘12’);
I was just wondering if you guys might turn the nullable option off for value in the table in future versions?
We’re also wondering here why asset ids are all stored in varchars, surely it’s quicker to store data that only ever seems to be integer in some form of int?
Just wondering…
Cheers,
Dave.