From c94fb9e51326cf4528574e191f9375e9cb22c723 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 13 Sep 2012 12:47:07 +0200 Subject: Add --omit-drop and --omit-create options --- odb/relational/schema.hxx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'odb/relational/schema.hxx') 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) { -- cgit v1.1