From b9055ec9d4057822f2955066bdec59c71418feef Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 12 Oct 2018 14:31:10 +0300 Subject: Recreate database schema extras on migration --- libbrep/.gitignore | 4 ++++ libbrep/build-extra.sql | 3 +++ libbrep/package-extra.sql | 7 +++++++ libbrep/package.hxx | 2 +- libbrep/package.xml | 2 ++ 5 files changed, 17 insertions(+), 1 deletion(-) (limited to 'libbrep') 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 @@ + + -- cgit v1.1