aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-07-23 13:01:53 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-07-23 13:44:14 +0300
commit247ebd5e7b987c180fbd896af4b9d29808e3c0d1 (patch)
tree751d5497d6c60c9e8ee0c400c37a8797e83516ee
parent84b7b5ee05ed865975f769270bd8a56f3a9059d6 (diff)
Drop all database migrations to be backward compatible with only 0.13.0 (one minor version behind)
-rw-r--r--libbrep/build-extra.sql6
-rw-r--r--libbrep/build.hxx9
-rw-r--r--libbrep/build.xml81
-rw-r--r--libbrep/package.hxx2
-rw-r--r--libbrep/package.xml314
-rw-r--r--migrate/migrate.cxx32
6 files changed, 81 insertions, 363 deletions
diff --git a/libbrep/build-extra.sql b/libbrep/build-extra.sql
index a61f415..ddc5961 100644
--- a/libbrep/build-extra.sql
+++ b/libbrep/build-extra.sql
@@ -18,12 +18,6 @@ DROP FOREIGN TABLE IF EXISTS build_repository;
DROP FOREIGN TABLE IF EXISTS build_tenant;
--- @@ TMP Also drop tables that are removed in 12 schema version. Drop these
--- statements after 0.13.0 is released.
---
-DROP FOREIGN TABLE IF EXISTS build_package_benchmarks;
-DROP FOREIGN TABLE IF EXISTS build_package_examples;
-
-- The foreign table for build_tenant object.
--
CREATE FOREIGN TABLE build_tenant (
diff --git a/libbrep/build.hxx b/libbrep/build.hxx
index 1041805..380b17b 100644
--- a/libbrep/build.hxx
+++ b/libbrep/build.hxx
@@ -23,7 +23,7 @@
// Used by the data migration entries.
//
-#define LIBBREP_BUILD_SCHEMA_VERSION_BASE 9
+#define LIBBREP_BUILD_SCHEMA_VERSION_BASE 12
#pragma db model version(LIBBREP_BUILD_SCHEMA_VERSION_BASE, 12, closed)
@@ -254,7 +254,12 @@ namespace brep
//
#pragma db member(timestamp) index
- // @@ TMP remove when 0.13.0 is released.
+ // This is not required since 0.14.0. Note however, that just dropping
+ // this line won't pan out since this would require migration which odb is
+ // currently unable to handle automatically, advising to re-implement this
+ // change by adding a new data member with the desired default value,
+ // migrating the data, and deleting the old data member. This sounds a bit
+ // hairy, so let's keep it for now.
//
#pragma db member(completion_timestamp) default(0)
diff --git a/libbrep/build.xml b/libbrep/build.xml
index 03d60e7..3af7640 100644
--- a/libbrep/build.xml
+++ b/libbrep/build.xml
@@ -1,49 +1,5 @@
<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" database="pgsql" schema-name="build" version="1">
- <changeset version="12"/>
-
- <changeset version="11"/>
-
- <changeset version="10">
- <alter-table name="build">
- <add-column name="completion_timestamp" type="BIGINT" null="false" default="0"/>
- </alter-table>
- <add-table name="build_delay" kind="object">
- <column name="package_tenant" type="TEXT" null="false"/>
- <column name="package_name" type="CITEXT" null="false"/>
- <column name="package_version_epoch" type="INTEGER" null="false"/>
- <column name="package_version_canonical_upstream" type="TEXT" null="false"/>
- <column name="package_version_canonical_release" type="TEXT" null="false" options="COLLATE &quot;C&quot;"/>
- <column name="package_version_revision" type="INTEGER" null="false"/>
- <column name="configuration" type="TEXT" null="false"/>
- <column name="toolchain_name" type="TEXT" null="false"/>
- <column name="toolchain_version_epoch" type="INTEGER" null="false"/>
- <column name="toolchain_version_canonical_upstream" type="TEXT" null="false"/>
- <column name="toolchain_version_canonical_release" type="TEXT" null="false" options="COLLATE &quot;C&quot;"/>
- <column name="toolchain_version_revision" type="INTEGER" null="false"/>
- <column name="package_version_upstream" type="TEXT" null="false"/>
- <column name="package_version_release" type="TEXT" null="true"/>
- <column name="toolchain_version_upstream" type="TEXT" null="false"/>
- <column name="toolchain_version_release" type="TEXT" null="true"/>
- <column name="report_timestamp" type="BIGINT" null="false"/>
- <column name="package_timestamp" type="BIGINT" null="false"/>
- <primary-key>
- <column name="package_tenant"/>
- <column name="package_name"/>
- <column name="package_version_epoch"/>
- <column name="package_version_canonical_upstream"/>
- <column name="package_version_canonical_release"/>
- <column name="package_version_revision"/>
- <column name="configuration"/>
- <column name="toolchain_name"/>
- <column name="toolchain_version_epoch"/>
- <column name="toolchain_version_canonical_upstream"/>
- <column name="toolchain_version_canonical_release"/>
- <column name="toolchain_version_revision"/>
- </primary-key>
- </add-table>
- </changeset>
-
- <model version="9">
+ <model version="12">
<table name="build" kind="object">
<column name="package_tenant" type="TEXT" null="false"/>
<column name="package_name" type="CITEXT" null="false"/>
@@ -65,6 +21,7 @@
<column name="timestamp" type="BIGINT" null="false"/>
<column name="force" type="TEXT" null="false"/>
<column name="status" type="TEXT" null="true"/>
+ <column name="completion_timestamp" type="BIGINT" null="false" default="0"/>
<column name="agent_fingerprint" type="TEXT" null="true"/>
<column name="agent_challenge" type="TEXT" null="true"/>
<column name="machine" type="TEXT" null="false"/>
@@ -151,5 +108,39 @@
<column name="index"/>
</index>
</table>
+ <table name="build_delay" kind="object">
+ <column name="package_tenant" type="TEXT" null="false"/>
+ <column name="package_name" type="CITEXT" null="false"/>
+ <column name="package_version_epoch" type="INTEGER" null="false"/>
+ <column name="package_version_canonical_upstream" type="TEXT" null="false"/>
+ <column name="package_version_canonical_release" type="TEXT" null="false" options="COLLATE &quot;C&quot;"/>
+ <column name="package_version_revision" type="INTEGER" null="false"/>
+ <column name="configuration" type="TEXT" null="false"/>
+ <column name="toolchain_name" type="TEXT" null="false"/>
+ <column name="toolchain_version_epoch" type="INTEGER" null="false"/>
+ <column name="toolchain_version_canonical_upstream" type="TEXT" null="false"/>
+ <column name="toolchain_version_canonical_release" type="TEXT" null="false" options="COLLATE &quot;C&quot;"/>
+ <column name="toolchain_version_revision" type="INTEGER" null="false"/>
+ <column name="package_version_upstream" type="TEXT" null="false"/>
+ <column name="package_version_release" type="TEXT" null="true"/>
+ <column name="toolchain_version_upstream" type="TEXT" null="false"/>
+ <column name="toolchain_version_release" type="TEXT" null="true"/>
+ <column name="report_timestamp" type="BIGINT" null="false"/>
+ <column name="package_timestamp" type="BIGINT" null="false"/>
+ <primary-key>
+ <column name="package_tenant"/>
+ <column name="package_name"/>
+ <column name="package_version_epoch"/>
+ <column name="package_version_canonical_upstream"/>
+ <column name="package_version_canonical_release"/>
+ <column name="package_version_revision"/>
+ <column name="configuration"/>
+ <column name="toolchain_name"/>
+ <column name="toolchain_version_epoch"/>
+ <column name="toolchain_version_canonical_upstream"/>
+ <column name="toolchain_version_canonical_release"/>
+ <column name="toolchain_version_revision"/>
+ </primary-key>
+ </table>
</model>
</changelog>
diff --git a/libbrep/package.hxx b/libbrep/package.hxx
index 65408a8..33444a9 100644
--- a/libbrep/package.hxx
+++ b/libbrep/package.hxx
@@ -18,7 +18,7 @@
// Used by the data migration entries.
//
-#define LIBBREP_PACKAGE_SCHEMA_VERSION_BASE 17
+#define LIBBREP_PACKAGE_SCHEMA_VERSION_BASE 19
#pragma db model version(LIBBREP_PACKAGE_SCHEMA_VERSION_BASE, 19, closed)
diff --git a/libbrep/package.xml b/libbrep/package.xml
index e650555..454cdbc 100644
--- a/libbrep/package.xml
+++ b/libbrep/package.xml
@@ -1,85 +1,5 @@
<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" database="pgsql" schema-name="package" version="1">
- <changeset version="19">
- <alter-table name="package_tests">
- <add-column name="test_name" type="CITEXT" null="false"/>
- <add-column name="test_min_version_epoch" type="INTEGER" null="true"/>
- <add-column name="test_min_version_canonical_upstream" type="TEXT" null="true"/>
- <add-column name="test_min_version_canonical_release" type="TEXT" null="true"/>
- <add-column name="test_min_version_revision" type="INTEGER" null="true"/>
- <add-column name="test_min_version_upstream" type="TEXT" null="true"/>
- <add-column name="test_min_version_release" type="TEXT" null="true"/>
- <add-column name="test_max_version_epoch" type="INTEGER" null="true"/>
- <add-column name="test_max_version_canonical_upstream" type="TEXT" null="true"/>
- <add-column name="test_max_version_canonical_release" type="TEXT" null="true"/>
- <add-column name="test_max_version_revision" type="INTEGER" null="true"/>
- <add-column name="test_max_version_upstream" type="TEXT" null="true"/>
- <add-column name="test_max_version_release" type="TEXT" null="true"/>
- <add-column name="test_min_open" type="BOOLEAN" null="true"/>
- <add-column name="test_max_open" type="BOOLEAN" null="true"/>
- <add-column name="test_package_tenant" type="TEXT" null="true"/>
- <add-column name="test_package_name" type="CITEXT" null="true"/>
- <add-column name="test_package_version_epoch" type="INTEGER" null="true"/>
- <add-column name="test_package_version_canonical_upstream" type="TEXT" null="true"/>
- <add-column name="test_package_version_canonical_release" type="TEXT" null="true" options="COLLATE &quot;C&quot;"/>
- <add-column name="test_package_version_revision" type="INTEGER" null="true"/>
- <add-column name="test_type" type="TEXT" null="false"/>
- <add-foreign-key name="test_package_tenant_fk" deferrable="DEFERRED">
- <column name="test_package_tenant"/>
- <references table="tenant">
- <column name="id"/>
- </references>
- </add-foreign-key>
- <add-foreign-key name="test_package_fk" deferrable="DEFERRED">
- <column name="test_package_tenant"/>
- <column name="test_package_name"/>
- <column name="test_package_version_epoch"/>
- <column name="test_package_version_canonical_upstream"/>
- <column name="test_package_version_canonical_release"/>
- <column name="test_package_version_revision"/>
- <references table="package">
- <column name="tenant"/>
- <column name="name"/>
- <column name="version_epoch"/>
- <column name="version_canonical_upstream"/>
- <column name="version_canonical_release"/>
- <column name="version_revision"/>
- </references>
- </add-foreign-key>
- <drop-foreign-key name="dep_package_tenant_fk"/>
- <drop-foreign-key name="dep_package_fk"/>
- <drop-column name="dep_name"/>
- <drop-column name="dep_min_version_epoch"/>
- <drop-column name="dep_min_version_canonical_upstream"/>
- <drop-column name="dep_min_version_canonical_release"/>
- <drop-column name="dep_min_version_revision"/>
- <drop-column name="dep_min_version_upstream"/>
- <drop-column name="dep_min_version_release"/>
- <drop-column name="dep_max_version_epoch"/>
- <drop-column name="dep_max_version_canonical_upstream"/>
- <drop-column name="dep_max_version_canonical_release"/>
- <drop-column name="dep_max_version_revision"/>
- <drop-column name="dep_max_version_upstream"/>
- <drop-column name="dep_max_version_release"/>
- <drop-column name="dep_min_open"/>
- <drop-column name="dep_max_open"/>
- <drop-column name="dep_package_tenant"/>
- <drop-column name="dep_package_name"/>
- <drop-column name="dep_package_version_epoch"/>
- <drop-column name="dep_package_version_canonical_upstream"/>
- <drop-column name="dep_package_version_canonical_release"/>
- <drop-column name="dep_package_version_revision"/>
- </alter-table>
- <drop-table name="package_examples"/>
- <drop-table name="package_benchmarks"/>
- </changeset>
-
- <changeset version="18">
- <alter-table name="package">
- <add-column name="unbuildable_reason" type="TEXT" null="true"/>
- </alter-table>
- </changeset>
-
- <model version="17">
+ <model version="19">
<table name="tenant" kind="object">
<column name="id" type="TEXT" null="false"/>
<column name="creation_timestamp" type="BIGINT" null="false"/>
@@ -247,6 +167,7 @@
<column name="fragment" type="TEXT" null="true"/>
<column name="sha256sum" type="TEXT" null="true"/>
<column name="buildable" type="BOOLEAN" null="false"/>
+ <column name="unbuildable_reason" type="TEXT" null="true"/>
<column name="search_index" type="tsvector" null="true"/>
<primary-key>
<column name="tenant"/>
@@ -672,27 +593,28 @@
<column name="version_canonical_release" type="TEXT" null="false" options="COLLATE &quot;C&quot;"/>
<column name="version_revision" type="INTEGER" null="false"/>
<column name="index" type="BIGINT" null="false"/>
- <column name="dep_name" type="CITEXT" null="false"/>
- <column name="dep_min_version_epoch" type="INTEGER" null="true"/>
- <column name="dep_min_version_canonical_upstream" type="TEXT" null="true"/>
- <column name="dep_min_version_canonical_release" type="TEXT" null="true"/>
- <column name="dep_min_version_revision" type="INTEGER" null="true"/>
- <column name="dep_min_version_upstream" type="TEXT" null="true"/>
- <column name="dep_min_version_release" type="TEXT" null="true"/>
- <column name="dep_max_version_epoch" type="INTEGER" null="true"/>
- <column name="dep_max_version_canonical_upstream" type="TEXT" null="true"/>
- <column name="dep_max_version_canonical_release" type="TEXT" null="true"/>
- <column name="dep_max_version_revision" type="INTEGER" null="true"/>
- <column name="dep_max_version_upstream" type="TEXT" null="true"/>
- <column name="dep_max_version_release" type="TEXT" null="true"/>
- <column name="dep_min_open" type="BOOLEAN" null="true"/>
- <column name="dep_max_open" type="BOOLEAN" null="true"/>
- <column name="dep_package_tenant" type="TEXT" null="true"/>
- <column name="dep_package_name" type="CITEXT" null="true"/>
- <column name="dep_package_version_epoch" type="INTEGER" null="true"/>
- <column name="dep_package_version_canonical_upstream" type="TEXT" null="true"/>
- <column name="dep_package_version_canonical_release" type="TEXT" null="true" options="COLLATE &quot;C&quot;"/>
- <column name="dep_package_version_revision" type="INTEGER" null="true"/>
+ <column name="test_name" type="CITEXT" null="false"/>
+ <column name="test_min_version_epoch" type="INTEGER" null="true"/>
+ <column name="test_min_version_canonical_upstream" type="TEXT" null="true"/>
+ <column name="test_min_version_canonical_release" type="TEXT" null="true"/>
+ <column name="test_min_version_revision" type="INTEGER" null="true"/>
+ <column name="test_min_version_upstream" type="TEXT" null="true"/>
+ <column name="test_min_version_release" type="TEXT" null="true"/>
+ <column name="test_max_version_epoch" type="INTEGER" null="true"/>
+ <column name="test_max_version_canonical_upstream" type="TEXT" null="true"/>
+ <column name="test_max_version_canonical_release" type="TEXT" null="true"/>
+ <column name="test_max_version_revision" type="INTEGER" null="true"/>
+ <column name="test_max_version_upstream" type="TEXT" null="true"/>
+ <column name="test_max_version_release" type="TEXT" null="true"/>
+ <column name="test_min_open" type="BOOLEAN" null="true"/>
+ <column name="test_max_open" type="BOOLEAN" null="true"/>
+ <column name="test_package_tenant" type="TEXT" null="true"/>
+ <column name="test_package_name" type="CITEXT" null="true"/>
+ <column name="test_package_version_epoch" type="INTEGER" null="true"/>
+ <column name="test_package_version_canonical_upstream" type="TEXT" null="true"/>
+ <column name="test_package_version_canonical_release" type="TEXT" null="true" options="COLLATE &quot;C&quot;"/>
+ <column name="test_package_version_revision" type="INTEGER" null="true"/>
+ <column name="test_type" type="TEXT" null="false"/>
<foreign-key name="tenant_fk" deferrable="DEFERRED">
<column name="tenant"/>
<references table="tenant">
@@ -726,189 +648,19 @@
<index name="package_tests_index_i">
<column name="index"/>
</index>
- <foreign-key name="dep_package_tenant_fk" deferrable="DEFERRED">
- <column name="dep_package_tenant"/>
- <references table="tenant">
- <column name="id"/>
- </references>
- </foreign-key>
- <foreign-key name="dep_package_fk" deferrable="DEFERRED">
- <column name="dep_package_tenant"/>
- <column name="dep_package_name"/>
- <column name="dep_package_version_epoch"/>
- <column name="dep_package_version_canonical_upstream"/>
- <column name="dep_package_version_canonical_release"/>
- <column name="dep_package_version_revision"/>
- <references table="package">
- <column name="tenant"/>
- <column name="name"/>
- <column name="version_epoch"/>
- <column name="version_canonical_upstream"/>
- <column name="version_canonical_release"/>
- <column name="version_revision"/>
- </references>
- </foreign-key>
- </table>
- <table name="package_examples" kind="container">
- <column name="tenant" type="TEXT" null="false"/>
- <column name="name" type="CITEXT" null="false"/>
- <column name="version_epoch" type="INTEGER" null="false"/>
- <column name="version_canonical_upstream" type="TEXT" null="false"/>
- <column name="version_canonical_release" type="TEXT" null="false" options="COLLATE &quot;C&quot;"/>
- <column name="version_revision" type="INTEGER" null="false"/>
- <column name="index" type="BIGINT" null="false"/>
- <column name="dep_name" type="CITEXT" null="false"/>
- <column name="dep_min_version_epoch" type="INTEGER" null="true"/>
- <column name="dep_min_version_canonical_upstream" type="TEXT" null="true"/>
- <column name="dep_min_version_canonical_release" type="TEXT" null="true"/>
- <column name="dep_min_version_revision" type="INTEGER" null="true"/>
- <column name="dep_min_version_upstream" type="TEXT" null="true"/>
- <column name="dep_min_version_release" type="TEXT" null="true"/>
- <column name="dep_max_version_epoch" type="INTEGER" null="true"/>
- <column name="dep_max_version_canonical_upstream" type="TEXT" null="true"/>
- <column name="dep_max_version_canonical_release" type="TEXT" null="true"/>
- <column name="dep_max_version_revision" type="INTEGER" null="true"/>
- <column name="dep_max_version_upstream" type="TEXT" null="true"/>
- <column name="dep_max_version_release" type="TEXT" null="true"/>
- <column name="dep_min_open" type="BOOLEAN" null="true"/>
- <column name="dep_max_open" type="BOOLEAN" null="true"/>
- <column name="dep_package_tenant" type="TEXT" null="true"/>
- <column name="dep_package_name" type="CITEXT" null="true"/>
- <column name="dep_package_version_epoch" type="INTEGER" null="true"/>
- <column name="dep_package_version_canonical_upstream" type="TEXT" null="true"/>
- <column name="dep_package_version_canonical_release" type="TEXT" null="true" options="COLLATE &quot;C&quot;"/>
- <column name="dep_package_version_revision" type="INTEGER" null="true"/>
- <foreign-key name="tenant_fk" deferrable="DEFERRED">
- <column name="tenant"/>
- <references table="tenant">
- <column name="id"/>
- </references>
- </foreign-key>
- <foreign-key name="object_id_fk" on-delete="CASCADE">
- <column name="tenant"/>
- <column name="name"/>
- <column name="version_epoch"/>
- <column name="version_canonical_upstream"/>
- <column name="version_canonical_release"/>
- <column name="version_revision"/>
- <references table="package">
- <column name="tenant"/>
- <column name="name"/>
- <column name="version_epoch"/>
- <column name="version_canonical_upstream"/>
- <column name="version_canonical_release"/>
- <column name="version_revision"/>
- </references>
- </foreign-key>
- <index name="package_examples_object_id_i">
- <column name="tenant"/>
- <column name="name"/>
- <column name="version_epoch"/>
- <column name="version_canonical_upstream"/>
- <column name="version_canonical_release"/>
- <column name="version_revision"/>
- </index>
- <index name="package_examples_index_i">
- <column name="index"/>
- </index>
- <foreign-key name="dep_package_tenant_fk" deferrable="DEFERRED">
- <column name="dep_package_tenant"/>
- <references table="tenant">
- <column name="id"/>
- </references>
- </foreign-key>
- <foreign-key name="dep_package_fk" deferrable="DEFERRED">
- <column name="dep_package_tenant"/>
- <column name="dep_package_name"/>
- <column name="dep_package_version_epoch"/>
- <column name="dep_package_version_canonical_upstream"/>
- <column name="dep_package_version_canonical_release"/>
- <column name="dep_package_version_revision"/>
- <references table="package">
- <column name="tenant"/>
- <column name="name"/>
- <column name="version_epoch"/>
- <column name="version_canonical_upstream"/>
- <column name="version_canonical_release"/>
- <column name="version_revision"/>
- </references>
- </foreign-key>
- </table>
- <table name="package_benchmarks" kind="container">
- <column name="tenant" type="TEXT" null="false"/>
- <column name="name" type="CITEXT" null="false"/>
- <column name="version_epoch" type="INTEGER" null="false"/>
- <column name="version_canonical_upstream" type="TEXT" null="false"/>
- <column name="version_canonical_release" type="TEXT" null="false" options="COLLATE &quot;C&quot;"/>
- <column name="version_revision" type="INTEGER" null="false"/>
- <column name="index" type="BIGINT" null="false"/>
- <column name="dep_name" type="CITEXT" null="false"/>
- <column name="dep_min_version_epoch" type="INTEGER" null="true"/>
- <column name="dep_min_version_canonical_upstream" type="TEXT" null="true"/>
- <column name="dep_min_version_canonical_release" type="TEXT" null="true"/>
- <column name="dep_min_version_revision" type="INTEGER" null="true"/>
- <column name="dep_min_version_upstream" type="TEXT" null="true"/>
- <column name="dep_min_version_release" type="TEXT" null="true"/>
- <column name="dep_max_version_epoch" type="INTEGER" null="true"/>
- <column name="dep_max_version_canonical_upstream" type="TEXT" null="true"/>
- <column name="dep_max_version_canonical_release" type="TEXT" null="true"/>
- <column name="dep_max_version_revision" type="INTEGER" null="true"/>
- <column name="dep_max_version_upstream" type="TEXT" null="true"/>
- <column name="dep_max_version_release" type="TEXT" null="true"/>
- <column name="dep_min_open" type="BOOLEAN" null="true"/>
- <column name="dep_max_open" type="BOOLEAN" null="true"/>
- <column name="dep_package_tenant" type="TEXT" null="true"/>
- <column name="dep_package_name" type="CITEXT" null="true"/>
- <column name="dep_package_version_epoch" type="INTEGER" null="true"/>
- <column name="dep_package_version_canonical_upstream" type="TEXT" null="true"/>
- <column name="dep_package_version_canonical_release" type="TEXT" null="true" options="COLLATE &quot;C&quot;"/>
- <column name="dep_package_version_revision" type="INTEGER" null="true"/>
- <foreign-key name="tenant_fk" deferrable="DEFERRED">
- <column name="tenant"/>
- <references table="tenant">
- <column name="id"/>
- </references>
- </foreign-key>
- <foreign-key name="object_id_fk" on-delete="CASCADE">
- <column name="tenant"/>
- <column name="name"/>
- <column name="version_epoch"/>
- <column name="version_canonical_upstream"/>
- <column name="version_canonical_release"/>
- <column name="version_revision"/>
- <references table="package">
- <column name="tenant"/>
- <column name="name"/>
- <column name="version_epoch"/>
- <column name="version_canonical_upstream"/>
- <column name="version_canonical_release"/>
- <column name="version_revision"/>
- </references>
- </foreign-key>
- <index name="package_benchmarks_object_id_i">
- <column name="tenant"/>
- <column name="name"/>
- <column name="version_epoch"/>
- <column name="version_canonical_upstream"/>
- <column name="version_canonical_release"/>
- <column name="version_revision"/>
- </index>
- <index name="package_benchmarks_index_i">
- <column name="index"/>
- </index>
- <foreign-key name="dep_package_tenant_fk" deferrable="DEFERRED">
- <column name="dep_package_tenant"/>
+ <foreign-key name="test_package_tenant_fk" deferrable="DEFERRED">
+ <column name="test_package_tenant"/>
<references table="tenant">
<column name="id"/>
</references>
</foreign-key>
- <foreign-key name="dep_package_fk" deferrable="DEFERRED">
- <column name="dep_package_tenant"/>
- <column name="dep_package_name"/>
- <column name="dep_package_version_epoch"/>
- <column name="dep_package_version_canonical_upstream"/>
- <column name="dep_package_version_canonical_release"/>
- <column name="dep_package_version_revision"/>
+ <foreign-key name="test_package_fk" deferrable="DEFERRED">
+ <column name="test_package_tenant"/>
+ <column name="test_package_name"/>
+ <column name="test_package_version_epoch"/>
+ <column name="test_package_version_canonical_upstream"/>
+ <column name="test_package_version_canonical_release"/>
+ <column name="test_package_version_revision"/>
<references table="package">
<column name="tenant"/>
<column name="name"/>
diff --git a/migrate/migrate.cxx b/migrate/migrate.cxx
index 0ef6096..88c87c1 100644
--- a/migrate/migrate.cxx
+++ b/migrate/migrate.cxx
@@ -206,6 +206,7 @@ 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>;
@@ -217,36 +218,11 @@ struct package_migration_entry: package_migration_entry_base<v>
: package_migration_entry_base<v> (f, "package") {}
};
-// Set the unbuildable reason for unbuildable packages.
-//
-// Note that we are unable to restore the exact reason and so always set it
-// to 'unbuildable'.
-//
-// Also note that we don't set the buildable flag to false for the separate
-// test packages here. Implementing this properly in the data migration feels
-// hairy (see load/load.cxx for details). Instead we rely on brep-load to
-// handle this on the next tenant reload that can be enforced by using the
-// --force option.
-//
-//#if 0
-static const package_migration_entry<18>
-package_migrate_v18 ([] (database& db)
-{
- db.execute ("UPDATE package SET unbuildable_reason = 'unbuildable' "
- "WHERE NOT buildable");
-});
-//#endif
-
-// Merging the package examples and benchmarks tables into the package tests
-// table is a bit hairy. Thus, we won't bother with that and just cleanup the
-// amended package tests table, relying on the loader to fill it in a short
-// time.
-//
-static const package_migration_entry<19>
-package_migrate_v19 ([] (database& db)
+static const package_migration_entry<20>
+package_migrate_v20 ([] (database& db)
{
- db.execute ("DELETE from package_tests");
});
+#endif
// main() function
//