[gnue] r9781 - trunk/gnue-common/src/datasources/drivers/sql/interbase

[email protected]
Newsgroups gmane.comp.cms.gnue.cvs
Message-ID <[email protected]>
Author: johannes
Date: 2007-09-20 09:50:31 -0500 (Thu, 20 Sep 2007)
New Revision: 9781

Modified:
   trunk/gnue-common/src/datasources/drivers/sql/interbase/Behavior.py
Log:
Use unique Trigger names.  This avoids conflicts if two tables are using 
a serial with the same name


Modified: trunk/gnue-common/src/datasources/drivers/sql/interbase/Behavior.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sql/interbase/Behavior.py	2007-09-20 13:08:40 UTC (rev 9780)
+++ trunk/gnue-common/src/datasources/drivers/sql/interbase/Behavior.py	2007-09-20 14:50:31 UTC (rev 9781)
@@ -430,9 +430,9 @@
 
       code [0].append (u"CREATE GENERATOR %s" % seq)
       code [2].append ( \
-        u"CREATE TRIGGER trg_%s FOR %s ACTIVE BEFORE INSERT POSITION 0 AS " \
+        u"CREATE TRIGGER trg_%s_%s FOR %s ACTIVE BEFORE INSERT POSITION 0 AS " \
          "BEGIN IF (NEW.%s IS NULL) THEN NEW.%s = GEN_ID (%s,1); END" \
-        % (field.name, table.name, field.name, field.name, seq))
+        % (field.name, table.name, table.name, field.name, field.name, seq))
 
     elif field.defaultwith == 'timestamp':
       field.default = "NOW"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.