diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2019-09-03 00:18:20 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2019-09-05 16:57:22 +0300 |
commit | 2d907a525ab169f1cb97b87550e3646fde003733 (patch) | |
tree | fd6c820702a6a064bd6265d661ff77120064ac7c /migrate | |
parent | 32a92bfa9ca270f262b34b6cfc82825d84f9026c (diff) |
Adapt to optional package revision
Diffstat (limited to 'migrate')
-rw-r--r-- | migrate/migrate.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/migrate/migrate.cxx b/migrate/migrate.cxx index f012da1..3e2c53d 100644 --- a/migrate/migrate.cxx +++ b/migrate/migrate.cxx @@ -234,6 +234,27 @@ package_migrate_v15 ([] (database& db) "version_canonical_release = '~')"); }); +static const package_migration_entry<16> +package_migrate_v16 ([] (database& db) +{ + // Set the zero version revision to NULL. + // + auto migrate_rev = [&db] (const char* table, const char* column) + { + db.execute (string ("UPDATE ") + table + " SET " + column + " = NULL " + + "WHERE " + column + " = 0"); + }; + + // The depends package manifest value endpoint versions. + // + // Note that previously the zero and absent revisions had the same + // semantics. Now the semantics differs and the zero revision is preserved + // (see libbpkg/manifest.hxx for details). + // + migrate_rev ("package_dependency_alternatives", "dep_min_version_revision"); + migrate_rev ("package_dependency_alternatives", "dep_max_version_revision"); +}); + // main() function // int |