From e32e4b9d8d79dd5491891b1a2c5ac9ad9b631780 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 17 Sep 2013 12:01:47 +0200 Subject: Add schema name to changelog --- odb/semantics/relational/changelog.cxx | 3 +++ odb/semantics/relational/changelog.hxx | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'odb/semantics/relational') diff --git a/odb/semantics/relational/changelog.cxx b/odb/semantics/relational/changelog.cxx index 73dac77..800fb97 100644 --- a/odb/semantics/relational/changelog.cxx +++ b/odb/semantics/relational/changelog.cxx @@ -30,6 +30,7 @@ namespace semantics throw parsing (p, "unsupported changelog format version"); database_ = p.attribute ("database"); + schema_name_ = p.attribute ("schema-name", ""); // Because things are stored in the reverse order, first save the // changesets as XML chunks and then re-parse them in the reverse @@ -128,6 +129,8 @@ namespace semantics s.start_element (xmlns, "changelog"); s.namespace_decl (xmlns, ""); s.attribute ("database", database_); + if (!schema_name_.empty ()) + s.attribute ("schema-name", schema_name_); s.attribute ("version", 1); // Format version. // For better readability serialize things in reverse order so that diff --git a/odb/semantics/relational/changelog.hxx b/odb/semantics/relational/changelog.hxx index a27c946..c740c7c 100644 --- a/odb/semantics/relational/changelog.hxx +++ b/odb/semantics/relational/changelog.hxx @@ -122,8 +122,12 @@ namespace semantics string const& database () const {return database_;} + string const& + schema_name () const {return schema_name_;} + public: - changelog (string const& db): database_ (db), contains_model_ (0) {} + changelog (string const& db, string const& sn) + : database_ (db), schema_name_ (sn), contains_model_ (0) {} changelog (xml::parser&); void @@ -151,6 +155,7 @@ namespace semantics protected: string database_; + string schema_name_; contains_model_type* contains_model_; contains_changeset_list contains_changeset_; }; -- cgit v1.1