summaryrefslogtreecommitdiff
path: root/odb
diff options
context:
space:
mode:
authorConstantin Michael <constantin@codesynthesis.com>2011-10-26 15:43:24 +0200
committerConstantin Michael <constantin@codesynthesis.com>2011-10-26 16:04:14 +0200
commit66cfedecb3f7fe7d0fa7495d7ea8fea094a1d89c (patch)
tree806af8bb8bb35ab9ea770f070e5330df408d8763 /odb
parent3516d86bf1a027a6063e383094293be0ea62c5ff (diff)
Output DEFAULT clause before NULL specification when generating schema
Oracle requires that the DEFAULT clause appear before any column contraints are specified when creating a table.
Diffstat (limited to 'odb')
-rw-r--r--odb/relational/schema.hxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/odb/relational/schema.hxx b/odb/relational/schema.hxx
index 855f67f..81e1453 100644
--- a/odb/relational/schema.hxx
+++ b/odb/relational/schema.hxx
@@ -285,6 +285,10 @@ namespace relational
os << " " << quote_id (c.name ()) << " ";
type (c, pk != 0 && pk->auto_ ());
+
+ if (!c.default_ ().empty ())
+ os << " DEFAULT " << c.default_ ();
+
null (c);
// If this is a single-column primary key, generate it inline.
@@ -295,9 +299,6 @@ namespace relational
if (pk != 0 && pk->auto_ ())
auto_ (c);
- if (!c.default_ ().empty ())
- os << " DEFAULT " << c.default_ ();
-
if (!c.options ().empty ())
os << " " << c.options ();
}