mysql - Generic auto-increment foreign key -
i'm writing sql scripts run across platforms (mostly mysql , postgres). problem see cannot arrive @ common 1 auto-increment primary keys used foreign keys. there way ?
table t1 ( column c1 ) table t2 ( column c2 )
c1 auto increment , c2 foreign key referenced on c1.
i tried keeping c1 serial , c2 bigint/bigint unsigned/numeric , no luck.
really, futile try sql code work across multiple database platforms. there many variations on language.
in fact, syntax stored procedure differs between two. so, going have write separate scripts each database want support.
Comments
Post a Comment