diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-08-28 07:52:50 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-08-28 07:52:50 +0200 |
commit | c1f534db5d6bc29f9be0e7498e4971c7132d013a (patch) | |
tree | 198aef1cf6a2b84b929fbd54274875448f7e9a2e /odb/relational/source.hxx | |
parent | c4b6357a9908fb05261efa8764e5c8a6d8727b96 (diff) |
Support for added and deleted data member pragmas
Diffstat (limited to 'odb/relational/source.hxx')
-rw-r--r-- | odb/relational/source.hxx | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/odb/relational/source.hxx b/odb/relational/source.hxx index 9dbb4e9..3bf7c95 100644 --- a/odb/relational/source.hxx +++ b/odb/relational/source.hxx @@ -957,6 +957,9 @@ namespace relational if (var_override_.empty ()) { + // Ignore inverse, separately-loaded members in the main + // section (nothing to persist). + // if (section_ == 0 && separate_load (mi.m) && inverse (mi.m)) return false; @@ -3635,6 +3638,26 @@ namespace relational throw operation_failed (); } + // If the member is soft- added or deleted, check the version. + // + unsigned long long av (added (member_path_)); + unsigned long long dv (deleted (member_path_)); + if (av != 0 || dv != 0) + { + os << "if ("; + + if (av != 0) + os << "svm >= schema_version_migration (" << av << "ULL, true)"; + + if (av != 0 || dv != 0) + os << " &&" << endl; + + if (dv != 0) + os << "svm <= schema_version_migration (" << dv << "ULL, true)"; + + os << ")" << endl; + } + if (call_ != erase_id_call && (call_ != erase_obj_call || smart)) { os << "{"; |