From d259750511b3c2aaeace49f8ccb1d7f3ad561452 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 9 Dec 2021 15:47:34 +0300 Subject: Prepare for supporting multiple ids in requirement alternative --- migrate/migrate.cxx | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) (limited to 'migrate') diff --git a/migrate/migrate.cxx b/migrate/migrate.cxx index 627ee4f..7e009e0 100644 --- a/migrate/migrate.cxx +++ b/migrate/migrate.cxx @@ -222,9 +222,13 @@ struct package_migration_entry: package_migration_entry_base 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. + // Note that for both dependency and requirement + // package_*_alternative_*s.alternative_index is copied from + // package_*_alternatives.index and package_*_alternative_*s.index is set to + // 0. + // + + // Migrate dependencies. // db.execute ( "INSERT INTO \"package_dependency_alternative_dependencies\" " @@ -290,6 +294,33 @@ package_migrate_v22 ([] (database& db) "\"dep_package_version_canonical_release\", " "\"dep_package_version_revision\" " "FROM \"package_dependency_alternatives\""); + + // Migrate requirements. + // + db.execute ( + "INSERT INTO \"package_requirement_alternative_requirements\" " + "(\"tenant\", " + "\"name\", " + "\"version_epoch\", " + "\"version_canonical_upstream\", " + "\"version_canonical_release\", " + "\"version_revision\", " + "\"requirement_index\", " + "\"alternative_index\", " + "\"index\", " + "\"id\") " + "SELECT " + "\"tenant\", " + "\"name\", " + "\"version_epoch\", " + "\"version_canonical_upstream\", " + "\"version_canonical_release\", " + "\"version_revision\", " + "\"requirement_index\", " + "\"index\", " + "0, " + "\"id\" " + "FROM \"package_requirement_alternatives\""); }); // Register the data migration functions for the build database schema. -- cgit v1.1