aboutsummaryrefslogtreecommitdiff
path: root/libbrep
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-10-12 14:31:10 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-10-12 15:43:26 +0300
commitb9055ec9d4057822f2955066bdec59c71418feef (patch)
treea696da9a3a4a198ec5d723537c98a416c9f43768 /libbrep
parente97c6b9b9c90a6f97019021d6bfcc73ed92580cc (diff)
Recreate database schema extras on migration
Diffstat (limited to 'libbrep')
-rw-r--r--libbrep/.gitignore4
-rw-r--r--libbrep/build-extra.sql3
-rw-r--r--libbrep/package-extra.sql7
-rw-r--r--libbrep/package.hxx2
-rw-r--r--libbrep/package.xml2
5 files changed, 17 insertions, 1 deletions
diff --git a/libbrep/.gitignore b/libbrep/.gitignore
index 1fbfc28..1cf5d3e 100644
--- a/libbrep/.gitignore
+++ b/libbrep/.gitignore
@@ -2,9 +2,13 @@ common-odb.?xx
package-odb.?xx
package.sql
+package-???-pre.sql
+package-???-post.sql
package-extra.hxx
build-odb.?xx
build-package-odb.?xx
build.sql
+build-???-pre.sql
+build-???-post.sql
build-extra.hxx
diff --git a/libbrep/build-extra.sql b/libbrep/build-extra.sql
index cc43239..35ba361 100644
--- a/libbrep/build-extra.sql
+++ b/libbrep/build-extra.sql
@@ -2,6 +2,9 @@
-- parser complexity, there is a number of restrictions, see package-extra.sql
-- file for details.
--
+-- Increment the database 'build' schema version when update this file, see
+-- package-extra.sql file for details.
+--
DROP FOREIGN TABLE IF EXISTS build_package_constraints;
diff --git a/libbrep/package-extra.sql b/libbrep/package-extra.sql
index 93c61d8..86f055b 100644
--- a/libbrep/package-extra.sql
+++ b/libbrep/package-extra.sql
@@ -8,6 +8,13 @@
-- * strings other then function bodies must be quoted with ' or "
-- * statements must end with ";\n"
--
+-- Increment the database 'package' schema version when update this file. Note
+-- that the brep-migrate utility executes the drop SQL statements prior to the
+-- schema migration and the create statements afterwards. That, in particular,
+-- means that the extras may depend on the tables but not the other way
+-- around. Make sure that the drop statements properly handle entities created
+-- for all schema versions starting from LIBBREP_PACKAGE_SCHEMA_VERSION_BASE.
+--
-- There is no need to drop to_tsvector() explicitly, as we can rely on "DROP
-- TYPE IF EXISTS weighted_text CASCADE" statement below, which will drop all
diff --git a/libbrep/package.hxx b/libbrep/package.hxx
index fbe6f60..af4581c 100644
--- a/libbrep/package.hxx
+++ b/libbrep/package.hxx
@@ -21,7 +21,7 @@
//
#define LIBBREP_PACKAGE_SCHEMA_VERSION_BASE 7
-#pragma db model version(LIBBREP_PACKAGE_SCHEMA_VERSION_BASE, 7, closed)
+#pragma db model version(LIBBREP_PACKAGE_SCHEMA_VERSION_BASE, 8, open)
namespace brep
{
diff --git a/libbrep/package.xml b/libbrep/package.xml
index 7b74349..07c1be7 100644
--- a/libbrep/package.xml
+++ b/libbrep/package.xml
@@ -1,4 +1,6 @@
<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" database="pgsql" schema-name="package" version="1">
+ <changeset version="8"/>
+
<model version="7">
<table name="repository" kind="object">
<column name="tenant" type="TEXT" null="false"/>