aboutsummaryrefslogtreecommitdiff
path: root/odb/relational/schema.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-09-13 12:47:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-09-13 12:47:07 +0200
commitc94fb9e51326cf4528574e191f9375e9cb22c723 (patch)
tree370dc23eabb793d40d70cf15ab663010507b76ed /odb/relational/schema.hxx
parent519010bb77f813971570dceba068272ca2f5b600 (diff)
Add --omit-drop and --omit-create options
Diffstat (limited to 'odb/relational/schema.hxx')
-rw-r--r--odb/relational/schema.hxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/odb/relational/schema.hxx b/odb/relational/schema.hxx
index e6d4824..56857f3 100644
--- a/odb/relational/schema.hxx
+++ b/odb/relational/schema.hxx
@@ -797,7 +797,7 @@ namespace relational
post ()
{
if (!first_) // Ignore empty statements.
- os << strlit (line_) << ");" << endl;
+ os << strlit (line_) << ");";
}
private:
@@ -873,10 +873,12 @@ namespace relational
<< "{"
<< "ODB_POTENTIALLY_UNUSED (db);"
<< "ODB_POTENTIALLY_UNUSED (pass);"
+ << "ODB_POTENTIALLY_UNUSED (drop);"
<< endl;
// Drop.
//
+ if (!options.omit_drop ())
{
bool close (false);
@@ -904,11 +906,16 @@ namespace relational
// Create.
//
+ if (!options.omit_create ())
{
bool close (false);
- os << "else"
- << "{";
+ if (options.omit_drop ())
+ os << "if (!drop)";
+ else
+ os << "else";
+
+ os << "{";
for (unsigned short pass (1); pass < 3; ++pass)
{