aboutsummaryrefslogtreecommitdiff
path: root/migrate
diff options
context:
space:
mode:
Diffstat (limited to 'migrate')
-rw-r--r--migrate/migrate.cxx70
1 files changed, 68 insertions, 2 deletions
diff --git a/migrate/migrate.cxx b/migrate/migrate.cxx
index 6c66bf0..627ee4f 100644
--- a/migrate/migrate.cxx
+++ b/migrate/migrate.cxx
@@ -208,7 +208,6 @@ create (database& db, bool extra_only) const
// Register the data migration functions for the package database schema.
//
-#if 0
template <schema_version v>
using package_migration_entry_base =
data_migration_entry<v, LIBBREP_PACKAGE_SCHEMA_VERSION_BASE>;
@@ -223,8 +222,75 @@ struct package_migration_entry: package_migration_entry_base<v>
static const package_migration_entry<22>
package_migrate_v22 ([] (database& db)
{
+ // Note that package_dependency_alternative_dependencies.alternative_index
+ // is copied from package_dependency_alternatives.index and
+ // package_dependency_alternative_dependencies.index is set to 0.
+ //
+ db.execute (
+ "INSERT INTO \"package_dependency_alternative_dependencies\" "
+ "(\"tenant\", "
+ "\"name\", "
+ "\"version_epoch\", "
+ "\"version_canonical_upstream\", "
+ "\"version_canonical_release\", "
+ "\"version_revision\", "
+ "\"dependency_index\", "
+ "\"alternative_index\", "
+ "\"index\", "
+ "\"dep_name\", "
+ "\"dep_min_version_epoch\", "
+ "\"dep_min_version_canonical_upstream\", "
+ "\"dep_min_version_canonical_release\", "
+ "\"dep_min_version_revision\", "
+ "\"dep_min_version_upstream\", "
+ "\"dep_min_version_release\", "
+ "\"dep_max_version_epoch\", "
+ "\"dep_max_version_canonical_upstream\", "
+ "\"dep_max_version_canonical_release\", "
+ "\"dep_max_version_revision\", "
+ "\"dep_max_version_upstream\", "
+ "\"dep_max_version_release\", "
+ "\"dep_min_open\", "
+ "\"dep_max_open\", "
+ "\"dep_package_tenant\", "
+ "\"dep_package_name\", "
+ "\"dep_package_version_epoch\", "
+ "\"dep_package_version_canonical_upstream\", "
+ "\"dep_package_version_canonical_release\", "
+ "\"dep_package_version_revision\") "
+ "SELECT "
+ "\"tenant\", "
+ "\"name\", "
+ "\"version_epoch\", "
+ "\"version_canonical_upstream\", "
+ "\"version_canonical_release\", "
+ "\"version_revision\", "
+ "\"dependency_index\", "
+ "\"index\", "
+ "0, "
+ "\"dep_name\", "
+ "\"dep_min_version_epoch\", "
+ "\"dep_min_version_canonical_upstream\", "
+ "\"dep_min_version_canonical_release\", "
+ "\"dep_min_version_revision\", "
+ "\"dep_min_version_upstream\", "
+ "\"dep_min_version_release\", "
+ "\"dep_max_version_epoch\", "
+ "\"dep_max_version_canonical_upstream\", "
+ "\"dep_max_version_canonical_release\", "
+ "\"dep_max_version_revision\", "
+ "\"dep_max_version_upstream\", "
+ "\"dep_max_version_release\", "
+ "\"dep_min_open\", "
+ "\"dep_max_open\", "
+ "\"dep_package_tenant\", "
+ "\"dep_package_name\", "
+ "\"dep_package_version_epoch\", "
+ "\"dep_package_version_canonical_upstream\", "
+ "\"dep_package_version_canonical_release\", "
+ "\"dep_package_version_revision\" "
+ "FROM \"package_dependency_alternatives\"");
});
-#endif
// Register the data migration functions for the build database schema.
//