aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-09-28 08:39:47 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-09-28 08:39:47 +0200
commit5e7e037dd8c593e727f5a9672a2564257194cb48 (patch)
tree682ee0109659f640f58fbc9fdc681744b39fa10a
parenta6aae0cc4a2af798dd9808075cab92ac8139a36a (diff)
Don't ignore empty changesets
This can be useful, for example, in data-only migrations.
-rw-r--r--odb/relational/changelog.cxx14
1 files changed, 6 insertions, 8 deletions
diff --git a/odb/relational/changelog.cxx b/odb/relational/changelog.cxx
index 855ba65..d4d20f5 100644
--- a/odb/relational/changelog.cxx
+++ b/odb/relational/changelog.cxx
@@ -1094,8 +1094,6 @@ namespace relational
throw operation_failed ();
}
-
-
// Build the new changelog.
//
model& oldm (old->model ());
@@ -1220,13 +1218,13 @@ namespace relational
//
if (mv.base != mv.current)
{
+ // Add it even if it is empty. This can be useful, for example,
+ // for data-only migrations were the user relies on the database
+ // version being updated in the version table.
+ //
changeset& c (diff (*last, m, *cl, in_name, ops, &mv));
-
- if (!c.names_empty ())
- {
- g.new_edge<alters_model> (c, *last);
- g.new_edge<contains_changeset> (*cl, c);
- }
+ g.new_edge<alters_model> (c, *last);
+ g.new_edge<contains_changeset> (*cl, c);
}
return cl;