]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- moved change for [ticket:466] to ansisql, since thats the syntax for all databases.
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 17 Feb 2007 02:39:28 +0000 (02:39 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 17 Feb 2007 02:39:28 +0000 (02:39 +0000)
the change is across all dialects, not just oracle

CHANGES
lib/sqlalchemy/ansisql.py
lib/sqlalchemy/databases/oracle.py

diff --git a/CHANGES b/CHANGES
index 1862260513af2d6228d154e9092c2fa803638fc3..4cdf2ec4ee1b619ea0ff9053e6c584fa2bb25969 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -12,6 +12,7 @@
   can handle *args or a list instance for positional, **kwargs or a dict instance
   for named args, or a list of list or dicts to invoke executemany()
   - small fix to BoundMetaData to accept unicode or string URLs
+  - fixed named PrimaryKeyConstraint generation [ticket:466] courtesy andrija at gmail
 - orm:
   - another refactoring to relationship calculation.  Allows more accurate ORM behavior
   with relationships from/to/between mappers, particularly polymorphic mappers,
@@ -47,7 +48,6 @@
   - sequences on a non-pk column will properly fire off on INSERT
   - added PrefetchingResultProxy support to pre-fetch LOB columns when they are 
   known to be present, fixes [ticket:435]
-  - fixed named PrimaryKeyConstraint generation [ticket:466] courtesy andrija at gmail
 - mysql:
   - fix to reflection on older DB's that might return array() type for 
   "show variables like" statements
index 974319845d613a4c3b86f272139c1064782c2c25..6cb57e1489744ef574fb23baae317d411b466343 100644 (file)
@@ -746,9 +746,10 @@ class ANSISchemaGenerator(ANSISchemaBase):
     def visit_primary_key_constraint(self, constraint):
         if len(constraint) == 0:
             return
-        self.append(", \n\tPRIMARY KEY ")
+        self.append(", \n\t")
         if constraint.name is not None:
-            self.append("%s " % constraint.name)
+            self.append("CONSTRAINT %s " % constraint.name)
+        self.append("PRIMARY KEY ")
         self.append("(%s)" % (string.join([self.preparer.format_column(c) for c in constraint],', ')))
     
     def supports_alter(self):
index 2d77946c46547e19a4fc4eb731502f5a4a6ae015..5346c30dad23084f82c778efe34d06ad2fa9799e 100644 (file)
@@ -485,14 +485,6 @@ class OracleSchemaGenerator(ansisql.ANSISchemaGenerator):
             self.append("CREATE SEQUENCE %s" % self.preparer.format_sequence(sequence))
             self.execute()
 
-    def visit_primary_key_constraint(self, constraint):
-        if len(constraint) == 0:
-            return
-        self.append(", \n\t")
-        if constraint.name is not None:
-            self.append("CONSTRAINT %s " % constraint.name)
-        self.append("PRIMARY KEY ")
-        self.append("(%s)" % (string.join([self.preparer.format_column(c) for c in constraint],', ')))
      
 class OracleSchemaDropper(ansisql.ANSISchemaDropper):
     def visit_sequence(self, sequence):