]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 307764: CREATE TABLE column definitions should put DEFAULT attribute before NOT...
authorlpsolit%gmail.com <>
Mon, 12 Sep 2005 21:18:51 +0000 (21:18 +0000)
committerlpsolit%gmail.com <>
Mon, 12 Sep 2005 21:18:51 +0000 (21:18 +0000)
Bugzilla/DB/Schema.pm

index e77e6d85b5a39f9badefa986851309d96736c09e..5f8fe48695bad959215b6803de2ccf25bf868a66 100644 (file)
@@ -20,6 +20,7 @@
 # Contributor(s): Andrew Dunstan <andrew@dunslane.net>,
 #                 Edward J. Sabol <edwardjsabol@iname.com>
 #                 Max Kanat-Alexander <mkanat@bugzilla.org>
+#                 Lance Larsh <lance.larsh@oracle.com>
 
 package Bugzilla::DB::Schema;
 
@@ -1198,8 +1199,10 @@ sub get_type_ddl {
 
     my $fkref = $self->{enable_references} ? $finfo->{REFERENCES} : undef;
     my $type_ddl = $self->{db_specific}{$type} || $type;
-    $type_ddl .= " NOT NULL" if ($finfo->{NOTNULL});
+    # DEFAULT attribute must appear before any column constraints
+    # (e.g., NOT NULL), for Oracle
     $type_ddl .= " DEFAULT $default" if (defined($default));
+    $type_ddl .= " NOT NULL" if ($finfo->{NOTNULL});
     $type_ddl .= " PRIMARY KEY" if ($finfo->{PRIMARYKEY});
     $type_ddl .= "\n\t\t\t\tREFERENCES $fkref" if $fkref;