Commits

Mike Bayer committed c78a459

- moved change for [ticket:466] to ansisql, since thats the syntax for all databases.
the change is across all dialects, not just oracle

  • Participants
  • Parent commits f6ede38

Comments (0)

Files changed (3)

   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,
   - 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

File lib/sqlalchemy/ansisql.py

     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):

File lib/sqlalchemy/databases/oracle.py

             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):