diff options
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 << "{"; |