From 66cfedecb3f7fe7d0fa7495d7ea8fea094a1d89c Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Wed, 26 Oct 2011 15:43:24 +0200 Subject: 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. --- odb/relational/schema.hxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'odb/relational/schema.hxx') 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 (); } -- cgit v1.1