aboutsummaryrefslogtreecommitdiff
path: root/odb/validator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/validator.cxx')
-rw-r--r--odb/validator.cxx32
1 files changed, 32 insertions, 0 deletions
diff --git a/odb/validator.cxx b/odb/validator.cxx
index 080aaa4..2b0b46e 100644
--- a/odb/validator.cxx
+++ b/odb/validator.cxx
@@ -326,6 +326,38 @@ namespace
virtual void
traverse_object (type& c)
{
+ // Check the the deletion version makes sense.
+ //
+ if (unsigned long long v = deleted (c))
+ {
+ location_t l (c.get<location_t> ("deleted-location"));
+
+ if (!versioned ())
+ {
+ error (l) << "deleted member in non-versioned object model" << endl;
+ valid_ = false;
+ }
+ else
+ {
+ model_version const& mv (version ());
+
+ if (v > mv.current)
+ {
+ error (l) << "deletion version is greater than the current " <<
+ "model version" << endl;
+ valid_ = false;
+ }
+ else if (v <= mv.base)
+ {
+ error (l) << "deletion version is less than or equal to the " <<
+ "base model version" << endl;
+ info (c.location ()) << "delete this class since migration to " <<
+ "version " << v << " is no longer possible" << endl;
+ valid_ = false;
+ }
+ }
+ }
+
// Check that the callback function exist.
//
if (c.count ("callback"))