aboutsummaryrefslogtreecommitdiff
path: root/libbrep
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-04-01 21:50:16 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-04-05 12:55:51 +0300
commitd1662abccb91be4844efc1508ff8b0427019a27c (patch)
tree6a0a8e1f86b51f97af67e2b65d20898cc42218b2 /libbrep
parentca708a3f172e2f0ffab8638087b3e478de06b996 (diff)
Prepare to replacing package buildable flag with enumeration
Note that changing the data member type is not automatically handled by the ODB migration machinery. Thus, we split the schema change into two steps, with this commit implementing the first step (see migrate/migrate.cxx for details).
Diffstat (limited to 'libbrep')
-rw-r--r--libbrep/build-extra.sql2
-rw-r--r--libbrep/build-package.hxx2
-rw-r--r--libbrep/build.hxx2
-rw-r--r--libbrep/build.xml2
-rw-r--r--libbrep/package.hxx4
-rw-r--r--libbrep/package.xml7
6 files changed, 16 insertions, 3 deletions
diff --git a/libbrep/build-extra.sql b/libbrep/build-extra.sql
index 9ecbcb1..7b9fec5 100644
--- a/libbrep/build-extra.sql
+++ b/libbrep/build-extra.sql
@@ -49,7 +49,7 @@ CREATE FOREIGN TABLE build_package (
version_release TEXT NULL,
internal_repository_tenant TEXT NULL,
internal_repository_canonical_name TEXT NULL,
- buildable BOOLEAN NOT NULL)
+ buildable_ BOOLEAN NOT NULL)
SERVER package_server OPTIONS (table_name 'package');
-- The foreign table for the build_package object builds member (that is of a
diff --git a/libbrep/build-package.hxx b/libbrep/build-package.hxx
index 702f937..ffa9d0b 100644
--- a/libbrep/build-package.hxx
+++ b/libbrep/build-package.hxx
@@ -96,6 +96,8 @@ namespace brep
#pragma db member(builds) id_column("") value_column("")
#pragma db member(constraints) id_column("") value_column("")
+ #pragma db member(buildable) column("buildable_")
+
private:
friend class odb::access;
build_package () = default;
diff --git a/libbrep/build.hxx b/libbrep/build.hxx
index 83b30a8..a883fa0 100644
--- a/libbrep/build.hxx
+++ b/libbrep/build.hxx
@@ -25,7 +25,7 @@
//
#define LIBBREP_BUILD_SCHEMA_VERSION_BASE 9
-#pragma db model version(LIBBREP_BUILD_SCHEMA_VERSION_BASE, 10, closed)
+#pragma db model version(LIBBREP_BUILD_SCHEMA_VERSION_BASE, 11, closed)
// We have to keep these mappings at the global scope instead of inside
// the brep namespace because they need to be also effective in the
diff --git a/libbrep/build.xml b/libbrep/build.xml
index bf8920b..f4ba6cb 100644
--- a/libbrep/build.xml
+++ b/libbrep/build.xml
@@ -1,4 +1,6 @@
<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" database="pgsql" schema-name="build" version="1">
+ <changeset version="11"/>
+
<changeset version="10">
<alter-table name="build">
<add-column name="completion_timestamp" type="BIGINT" null="false" default="0"/>
diff --git a/libbrep/package.hxx b/libbrep/package.hxx
index 07bd2a0..f679c62 100644
--- a/libbrep/package.hxx
+++ b/libbrep/package.hxx
@@ -20,7 +20,7 @@
//
#define LIBBREP_PACKAGE_SCHEMA_VERSION_BASE 17
-#pragma db model version(LIBBREP_PACKAGE_SCHEMA_VERSION_BASE, 17, closed)
+#pragma db model version(LIBBREP_PACKAGE_SCHEMA_VERSION_BASE, 18, closed)
namespace brep
{
@@ -583,6 +583,8 @@ namespace brep
#pragma db member(other_repositories) \
id_column("") value_column("repository_") value_not_null
+ #pragma db member(buildable) column("buildable_")
+
// search_index
//
#pragma db member(search_index) virtual(weighted_text) null \
diff --git a/libbrep/package.xml b/libbrep/package.xml
index 785ae0f..292cd05 100644
--- a/libbrep/package.xml
+++ b/libbrep/package.xml
@@ -1,4 +1,11 @@
<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" database="pgsql" schema-name="package" version="1">
+ <changeset version="18">
+ <alter-table name="package">
+ <add-column name="buildable_" type="BOOLEAN" null="false"/>
+ <drop-column name="buildable"/>
+ </alter-table>
+ </changeset>
+
<model version="17">
<table name="tenant" kind="object">
<column name="id" type="TEXT" null="false"/>