From: lpsolit%gmail.com <> Date: Mon, 12 Sep 2005 21:18:51 +0000 (+0000) Subject: Bug 307764: CREATE TABLE column definitions should put DEFAULT attribute before NOT... X-Git-Tag: bugzilla-2.21.1~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af99ca82efac7367e862c7353a3536bd201f045f;p=thirdparty%2Fbugzilla.git Bug 307764: CREATE TABLE column definitions should put DEFAULT attribute before NOT NULL constraint - Patch by Lance Larsh r=mkanat a=justdave --- diff --git a/Bugzilla/DB/Schema.pm b/Bugzilla/DB/Schema.pm index e77e6d85b5..5f8fe48695 100644 --- a/Bugzilla/DB/Schema.pm +++ b/Bugzilla/DB/Schema.pm @@ -20,6 +20,7 @@ # Contributor(s): Andrew Dunstan , # Edward J. Sabol # Max Kanat-Alexander +# Lance Larsh 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;