diff options
author | lpsolit%gmail.com <> | 2005-09-12 23:18:51 +0200 |
---|---|---|
committer | lpsolit%gmail.com <> | 2005-09-12 23:18:51 +0200 |
commit | af99ca82efac7367e862c7353a3536bd201f045f (patch) | |
tree | 774fd18c711c7f1b3e276de436b7276b3b67174f /Bugzilla/DB | |
parent | 94054ee6c6c1bc09d7431b0bcdb844881f3bd9db (diff) | |
download | bugzilla-af99ca82efac7367e862c7353a3536bd201f045f.tar.gz bugzilla-af99ca82efac7367e862c7353a3536bd201f045f.tar.xz |
Bug 307764: CREATE TABLE column definitions should put DEFAULT attribute before NOT NULL constraint - Patch by Lance Larsh <lance.larsh@oracle.com> r=mkanat a=justdave
Diffstat (limited to 'Bugzilla/DB')
-rw-r--r-- | Bugzilla/DB/Schema.pm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Bugzilla/DB/Schema.pm b/Bugzilla/DB/Schema.pm index e77e6d85b..5f8fe4869 100644 --- a/Bugzilla/DB/Schema.pm +++ b/Bugzilla/DB/Schema.pm @@ -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; |