From 75ae497de6d3ae414b38fc00c250264ece1dcce3 Mon Sep 17 00:00:00 2001 From: Nathan Wagner Date: Tue, 5 Oct 2021 07:53:28 -0500 Subject: [PATCH] generate migration scripts within setup --- setup | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setup b/setup index 205753b..154110b 100755 --- a/setup +++ b/setup @@ -11,6 +11,8 @@ legacyfile=/usr/pgsql-9.5_9.5.20/share/contrib/postgis-2.5/legacy.sql legacyfile=/usr/pgsql-11/share/contrib/postgis-2.5/legacy.sql if [ "$what" = 'source' ]; then + psql -Aqt service=source -f scripts/gen_migration_id_script.sql > scripts/add_source_migration_id.sql + psql -Aqt service=source -f scripts/add_source_migration_id.sql { cat <<-EOS \set VERBOSITY 'terse' @@ -43,6 +45,8 @@ elif [ "$what" = 'target' ]; then # must setup the schema on the target, the disable_target_triggers() function # uses the posting table to figure out what tables to operate on + psql -Aqt service=target -f scripts/gen_migration_id_script.sql > scripts/add_target_migration_id.sql + psql -Aqt service=target -f scripts/add_target_migration_id.sql { cat <<-EOS \set VERBOSITY 'terse' @@ -52,7 +56,7 @@ elif [ "$what" = 'target' ]; then set search_path to migration; set client_min_messages to notice; - select add_schema_migration_ids(exclude := ARRAY['junk', 'archive'], initqueue := false); + -- select add_schema_migration_ids(exclude := ARRAY['junk', 'archive'], initqueue := false); select setup_schema(exclude := ARRAY['junk', 'archive'], initqueue := false); select disable_target_triggers(); EOS -- 2.50.1