'temporary_invoice_transactions', 'temporary_invoice_transactions_temp_invoice_tx_idx_unique', 'ADD', 'CREATE UNIQUE INDEX IF NOT EXISTS temporary_invoice_transactions_temp_invoice_tx_idx_unique ON finance_migration_test_tenant2_mod_finance_storage.temporary_invoice_transactions ' || $rmb$(concat_space_sql(lower(f_unaccent( 2020-12-14T16:44:18,043 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: ALTER TABLE finance_migration_test_tenant2_mod_finance_storage.temporary_invoice_transactions ADD COLUMN IF NOT EXISTS sourceInvoiceId UUID 2020-12-14T16:44:18,044 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: ALTER TABLE finance_migration_test_tenant2_mod_finance_storage.temporary_invoice_transactions ADD COLUMN IF NOT EXISTS sourceInvoiceId UUID 2020-12-14T16:44:18,044 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DO $$ BEGIN BEGIN ALTER TABLE temporary_invoice_transactions ADD CONSTRAINT sourceInvoiceId_invoice_transaction_summaries_fkey FOREIGN KEY (sourceInvoiceId) REFERENCES invoice_transaction_summaries; EXCEPTION WHEN duplicate_object OR duplicate_table THEN NULL; END; END $$ 2020-12-14T16:44:18,045 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DO $$ BEGIN BEGIN ALTER TABLE temporary_invoice_transactions ADD CONSTRAINT sourceInvoiceId_invoice_transaction_summaries_fkey FOREIGN KEY (sourceInvoiceId) REFERENCES invoice_transaction_summaries; EXCEPTION WHEN duplicate_object OR duplicate_table THEN NULL; END; END $$ 2020-12-14T16:44:18,045 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE INDEX IF NOT EXISTS temporary_invoice_transactions_sourceInvoiceId_idx ON finance_migration_test_tenant2_mod_finance_storage.temporary_invoice_transactions (sourceInvoiceId) 2020-12-14T16:44:18,046 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE INDEX IF NOT EXISTS temporary_invoice_transactions_sourceInvoiceId_idx ON finance_migration_test_tenant2_mod_finance_storage.temporary_invoice_transactions (sourceInvoiceId) 2020-12-14T16:44:18,046 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: INSERT INTO rmb_internal_analyze VALUES ('temporary_invoice_transactions') 2020-12-14T16:44:18,047 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: INSERT INTO rmb_internal_analyze VALUES ('temporary_invoice_transactions') 2020-12-14T16:44:18,047 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: ALTER TABLE finance_migration_test_tenant2_mod_finance_storage.temporary_invoice_transactions ADD COLUMN IF NOT EXISTS paymentEncumbranceId UUID 2020-12-14T16:44:18,047 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: ALTER TABLE finance_migration_test_tenant2_mod_finance_storage.temporary_invoice_transactions ADD COLUMN IF NOT EXISTS paymentEncumbranceId UUID 2020-12-14T16:44:18,047 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DO $$ BEGIN BEGIN ALTER TABLE temporary_invoice_transactions ADD CONSTRAINT paymentEncumbranceId_transaction_fkey FOREIGN KEY (paymentEncumbranceId) REFERENCES transaction; EXCEPTION WHEN duplicate_object OR duplicate_table THEN NULL; END; END $$ 2020-12-14T16:44:18,048 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DO $$ BEGIN BEGIN ALTER TABLE temporary_invoice_transactions ADD CONSTRAINT paymentEncumbranceId_transaction_fkey FOREIGN KEY (paymentEncumbranceId) REFERENCES transaction; EXCEPTION WHEN duplicate_object OR duplicate_table THEN NULL; END; END $$ 2020-12-14T16:44:18,048 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE INDEX IF NOT EXISTS temporary_invoice_transactions_paymentEncumbranceId_idx ON finance_migration_test_tenant2_mod_finance_storage.temporary_invoice_transactions (paymentEncumbranceId) 2020-12-14T16:44:18,049 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE INDEX IF NOT EXISTS temporary_invoice_transactions_paymentEncumbranceId_idx ON finance_migration_test_tenant2_mod_finance_storage.temporary_invoice_transactions (paymentEncumbranceId) 2020-12-14T16:44:18,049 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: INSERT INTO rmb_internal_analyze VALUES ('temporary_invoice_transactions') 2020-12-14T16:44:18,049 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: INSERT INTO rmb_internal_analyze VALUES ('temporary_invoice_transactions') 2020-12-14T16:44:18,049 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: ALTER TABLE finance_migration_test_tenant2_mod_finance_storage.temporary_invoice_transactions ADD COLUMN IF NOT EXISTS fromFundId UUID 2020-12-14T16:44:18,050 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: ALTER TABLE finance_migration_test_tenant2_mod_finance_storage.temporary_invoice_transactions ADD COLUMN IF NOT EXISTS fromFundId UUID 2020-12-14T16:44:18,050 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DO $$ BEGIN BEGIN ALTER TABLE temporary_invoice_transactions ADD CONSTRAINT fromFundId_fund_fkey FOREIGN KEY (fromFundId) REFERENCES fund; EXCEPTION WHEN duplicate_object OR duplicate_table THEN NULL; END; END $$ 2020-12-14T16:44:18,051 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DO $$ BEGIN BEGIN ALTER TABLE temporary_invoice_transactions ADD CONSTRAINT fromFundId_fund_fkey FOREIGN KEY (fromFundId) REFERENCES fund; EXCEPTION WHEN duplicate_object OR duplicate_table THEN NULL; END; END $$ 2020-12-14T16:44:18,051 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE INDEX IF NOT EXISTS temporary_invoice_transactions_fromFundId_idx ON finance_migration_test_tenant2_mod_finance_storage.temporary_invoice_transactions (fromFundId) 2020-12-14T16:44:18,052 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE INDEX IF NOT EXISTS temporary_invoice_transactions_fromFundId_idx ON finance_migration_test_tenant2_mod_finance_storage.temporary_invoice_transactions (fromFundId) 2020-12-14T16:44:18,052 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: INSERT INTO rmb_internal_analyze VALUES ('temporary_invoice_transactions') 2020-12-14T16:44:18,053 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: INSERT INTO rmb_internal_analyze VALUES ('temporary_invoice_transactions') 2020-12-14T16:44:18,053 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: ALTER TABLE finance_migration_test_tenant2_mod_finance_storage.temporary_invoice_transactions ADD COLUMN IF NOT EXISTS toFundId UUID 2020-12-14T16:44:18,053 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: ALTER TABLE finance_migration_test_tenant2_mod_finance_storage.temporary_invoice_transactions ADD COLUMN IF NOT EXISTS toFundId UUID 2020-12-14T16:44:18,053 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DO $$ BEGIN BEGIN ALTER TABLE temporary_invoice_transactions ADD CONSTRAINT toFundId_fund_fkey FOREIGN KEY (toFundId) REFERENCES fund; EXCEPTION WHEN duplicate_object OR duplicate_table THEN NULL; END; END $$ 2020-12-14T16:44:18,055 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DO $$ BEGIN BEGIN ALTER TABLE temporary_invoice_transactions ADD CONSTRAINT toFundId_fund_fkey FOREIGN KEY (toFundId) REFERENCES fund; EXCEPTION WHEN duplicate_object OR duplicate_table THEN NULL; END; END $$ 2020-12-14T16:44:18,055 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE INDEX IF NOT EXISTS temporary_invoice_transactions_toFundId_idx ON finance_migration_test_tenant2_mod_finance_storage.temporary_invoice_transactions (toFundId) 2020-12-14T16:44:18,056 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE INDEX IF NOT EXISTS temporary_invoice_transactions_toFundId_idx ON finance_migration_test_tenant2_mod_finance_storage.temporary_invoice_transactions (toFundId) 2020-12-14T16:44:18,056 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: INSERT INTO rmb_internal_analyze VALUES ('temporary_invoice_transactions') 2020-12-14T16:44:18,056 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: INSERT INTO rmb_internal_analyze VALUES ('temporary_invoice_transactions') 2020-12-14T16:44:18,056 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: ALTER TABLE finance_migration_test_tenant2_mod_finance_storage.temporary_invoice_transactions ADD COLUMN IF NOT EXISTS fiscalYearId UUID 2020-12-14T16:44:18,057 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: ALTER TABLE finance_migration_test_tenant2_mod_finance_storage.temporary_invoice_transactions ADD COLUMN IF NOT EXISTS fiscalYearId UUID 2020-12-14T16:44:18,057 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DO $$ BEGIN BEGIN ALTER TABLE temporary_invoice_transactions ADD CONSTRAINT fiscalYearId_fiscal_year_fkey FOREIGN KEY (fiscalYearId) REFERENCES fiscal_year; EXCEPTION WHEN duplicate_object OR duplicate_table THEN NULL; END; END $$ 2020-12-14T16:44:18,057 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DO $$ BEGIN BEGIN ALTER TABLE temporary_invoice_transactions ADD CONSTRAINT fiscalYearId_fiscal_year_fkey FOREIGN KEY (fiscalYearId) REFERENCES fiscal_year; EXCEPTION WHEN duplicate_object OR duplicate_table THEN NULL; END; END $$ 2020-12-14T16:44:18,057 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE INDEX IF NOT EXISTS temporary_invoice_transactions_fiscalYearId_idx ON finance_migration_test_tenant2_mod_finance_storage.temporary_invoice_transactions (fiscalYearId) 2020-12-14T16:44:18,058 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE INDEX IF NOT EXISTS temporary_invoice_transactions_fiscalYearId_idx ON finance_migration_test_tenant2_mod_finance_storage.temporary_invoice_transactions (fiscalYearId) 2020-12-14T16:44:18,058 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: INSERT INTO rmb_internal_analyze VALUES ('temporary_invoice_transactions') 2020-12-14T16:44:18,059 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: INSERT INTO rmb_internal_analyze VALUES ('temporary_invoice_transactions') 2020-12-14T16:44:18,059 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: ALTER TABLE finance_migration_test_tenant2_mod_finance_storage.temporary_invoice_transactions ADD COLUMN IF NOT EXISTS expenseClassId UUID 2020-12-14T16:44:18,059 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: ALTER TABLE finance_migration_test_tenant2_mod_finance_storage.temporary_invoice_transactions ADD COLUMN IF NOT EXISTS expenseClassId UUID 2020-12-14T16:44:18,060 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DO $$ BEGIN BEGIN ALTER TABLE temporary_invoice_transactions ADD CONSTRAINT expenseClassId_expense_class_fkey FOREIGN KEY (expenseClassId) REFERENCES expense_class; EXCEPTION WHEN duplicate_object OR duplicate_table THEN NULL; END; END $$ 2020-12-14T16:44:18,060 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DO $$ BEGIN BEGIN ALTER TABLE temporary_invoice_transactions ADD CONSTRAINT expenseClassId_expense_class_fkey FOREIGN KEY (expenseClassId) REFERENCES expense_class; EXCEPTION WHEN duplicate_object OR duplicate_table THEN NULL; END; END $$ 2020-12-14T16:44:18,060 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE INDEX IF NOT EXISTS temporary_invoice_transactions_expenseClassId_idx ON finance_migration_test_tenant2_mod_finance_storage.temporary_invoice_transactions (expenseClassId) 2020-12-14T16:44:18,061 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE INDEX IF NOT EXISTS temporary_invoice_transactions_expenseClassId_idx ON finance_migration_test_tenant2_mod_finance_storage.temporary_invoice_transactions (expenseClassId) 2020-12-14T16:44:18,061 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: INSERT INTO rmb_internal_analyze VALUES ('temporary_invoice_transactions') 2020-12-14T16:44:18,061 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: INSERT INTO rmb_internal_analyze VALUES ('temporary_invoice_transactions') 2020-12-14T16:44:18,062 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE OR REPLACE FUNCTION finance_migration_test_tenant2_mod_finance_storage.update_temporary_invoice_transactions_references() RETURNS TRIGGER AS $$ BEGIN NEW.sourceInvoiceId = (NEW.jsonb->>'sourceInvoiceId'); NEW.paymentEncumbranceId = (NEW.jsonb->>'paymentEncumbranceId'); NEW.fromFundId = (NEW.jsonb->>'fromFundId'); NEW.toFundId = (NEW.jsonb->>'toFundId'); NEW.fiscalYearId = (NEW.jsonb->>'fiscalYearId'); NEW.expenseClassId = (NEW.jsonb->>'expenseClassId'); RETURN NEW; END; $$ language 'plpgsql' 2020-12-14T16:44:18,062 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE OR REPLACE FUNCTION finance_migration_test_tenant2_mod_finance_storage.update_temporary_invoice_transactions_references() RETURNS TRIGGER AS $$ BEGIN NEW.sourceInvoiceId = (NEW.jsonb->>'sourceInvoiceId'); NEW.paymentEncumbranceId = (NEW.jsonb->>'paymentEncumbranceId'); NEW.fromFundId = (NEW.jsonb->>'fromFundId'); NEW.toFundId = (NEW.jsonb->>'toFundId'); 2020-12-14T16:44:18,062 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DROP TRIGGER IF EXISTS update_temporary_invoice_transactions_references ON finance_migration_test_tenant2_mod_finance_storage.temporary_invoice_transactions CASCADE 2020-12-14T16:44:18,064 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DROP TRIGGER IF EXISTS update_temporary_invoice_transactions_references ON finance_migration_test_tenant2_mod_finance_storage.temporary_invoice_transactions CASCADE 2020-12-14T16:44:18,064 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE TRIGGER update_temporary_invoice_transactions_references BEFORE INSERT OR UPDATE ON finance_migration_test_tenant2_mod_finance_storage.temporary_invoice_transactions FOR EACH ROW EXECUTE PROCEDURE finance_migration_test_tenant2_mod_finance_storage.update_temporary_invoice_transactions_references() 2020-12-14T16:44:18,064 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE TRIGGER update_temporary_invoice_transactions_references BEFORE INSERT OR UPDATE ON finance_migration_test_tenant2_mod_finance_storage.temporary_invoice_transactions FOR EACH ROW EXECUTE PROCEDURE finance_migration_test_tenant2_mod_finance_storage.update_temporary_invoice_transactions_references() 2020-12-14T16:44:18,064 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DO $$ DECLARE version TEXT; i INT; BEGIN SELECT jsonb->>'rmbVersion' INTO version FROM rmb_internal; IF version !~ '^(\d\.|1\d\.|2\d\.|30\.0\.)' THEN RETURN; END IF; FOR i IN 1..50 LOOP EXECUTE 'ALTER TABLE temporary_invoice_transactions DROP CONSTRAINT IF EXISTS ' || 'sourceInvoiceId_invoice_transaction_summaries_fkey' || i; END LOOP; FOR i IN 1..50 LOOP EXECUTE 'ALTER TABLE temporary_invoice_transactions DROP CONSTRAINT IF EXISTS ' || 'paymentEncumbranceId_transaction_fkey' || i; END LOOP; FOR i IN 1..50 LOOP EXECUTE 'ALTER TABLE temporary_invoice_transactions DROP CONSTRAINT IF EXISTS ' || 'fromFundId_fund_fkey' || i; END LOOP; FOR i IN 1..50 LOOP EXECUTE 'ALTER TABLE temporary_invoice_transactions DROP CONSTRAINT IF EXISTS ' || 'toFundId_fund_fkey' || i; END LOOP; FOR i IN 1..50 LOOP 2020-12-14T16:44:18,066 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DO $$ DECLARE version TEXT; i INT; BEGIN SELECT jsonb->>'rmbVersion' INTO version FROM rmb_internal; IF version !~ '^(\d\.|1\d\.|2\d\.|30\.0\.)' THEN RETURN; END IF; FOR i IN 1..50 LOOP EXECUTE 'ALTER TABLE temporary_invoice_transactions DROP CONSTRAINT IF EXISTS ' || 'sourceInvoiceId_invoice_transaction_summaries_fke 2020-12-14T16:44:18,066 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DROP TRIGGER IF EXISTS update_temporary_invoice_payments_references ON finance_migration_test_tenant2_mod_finance_storage.temporary_invoice_payments CASCADE 2020-12-14T16:44:18,067 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DROP TRIGGER IF EXISTS update_temporary_invoice_payments_references ON finance_migration_test_tenant2_mod_finance_storage.temporary_invoice_payments CASCADE 2020-12-14T16:44:18,067 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DROP FUNCTION IF EXISTS finance_migration_test_tenant2_mod_finance_storage.update_temporary_invoice_payments_references() 2020-12-14T16:44:18,068 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DROP FUNCTION IF EXISTS finance_migration_test_tenant2_mod_finance_storage.update_temporary_invoice_payments_references() 2020-12-14T16:44:18,068 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE TABLE IF NOT EXISTS finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover ( id UUID PRIMARY KEY, jsonb JSONB NOT NULL ) 2020-12-14T16:44:18,078 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE TABLE IF NOT EXISTS finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover ( id UUID PRIMARY KEY, jsonb JSONB NOT NULL ) 2020-12-14T16:44:18,078 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DROP TRIGGER IF EXISTS set_id_injson_ledger_fiscal_year_rollover ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover CASCADE 2020-12-14T16:44:18,078 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DROP TRIGGER IF EXISTS set_id_injson_ledger_fiscal_year_rollover ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover CASCADE 2020-12-14T16:44:18,078 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DROP TRIGGER IF EXISTS set_id_in_jsonb ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover CASCADE 2020-12-14T16:44:18,079 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DROP TRIGGER IF EXISTS set_id_in_jsonb ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover CASCADE 2020-12-14T16:44:18,079 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE TRIGGER set_id_in_jsonb BEFORE INSERT OR UPDATE ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover FOR EACH ROW EXECUTE PROCEDURE finance_migration_test_tenant2_mod_finance_storage.set_id_in_jsonb() 2020-12-14T16:44:18,080 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE TRIGGER set_id_in_jsonb BEFORE INSERT OR UPDATE ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover FOR EACH ROW EXECUTE PROCEDURE finance_migration_test_tenant2_mod_finance_storage.set_id_in_jsonb() 2020-12-14T16:44:18,080 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: ALTER TABLE finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover ADD COLUMN IF NOT EXISTS creation_date timestamp, ADD COLUMN IF NOT EXISTS created_by text 2020-12-14T16:44:18,080 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: ALTER TABLE finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover ADD COLUMN IF NOT EXISTS creation_date timestamp, ADD COLUMN IF NOT EXISTS created_by text 2020-12-14T16:44:18,080 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DO $do$ BEGIN PERFORM rmb_internal_index( 'ledger_fiscal_year_rollover', 'ledger_fiscal_year_rollover_ledgerId_fromFiscalYearId_idx_unique', 'ADD', 'CREATE UNIQUE INDEX IF NOT EXISTS ledger_fiscal_year_rollover_ledgerId_fromFiscalYearId_idx_unique ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover ' || $rmb$(lower(f_unaccent(concat_space_sql(ledger_fiscal_year_rollover.jsonb->>'ledgerId' , ledger_fiscal_year_rollover.jsonb->>'fromFiscalYearId'))))$rmb$ ); END $do$ 2020-12-14T16:44:18,089 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DO $do$ BEGIN PERFORM rmb_internal_index( 'ledger_fiscal_year_rollover', 'ledger_fiscal_year_rollover_ledgerId_fromFiscalYearId_idx_unique', 'ADD', 'CREATE UNIQUE INDEX IF NOT EXISTS ledger_fiscal_year_rollover_ledgerId_fromFiscalYearId_idx_unique ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover ' || $rmb$(lower(f_unaccent(concat_sp 2020-12-14T16:44:18,089 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: ALTER TABLE finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover ADD COLUMN IF NOT EXISTS ledgerId UUID 2020-12-14T16:44:18,090 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: ALTER TABLE finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover ADD COLUMN IF NOT EXISTS ledgerId UUID 2020-12-14T16:44:18,090 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DO $$ BEGIN BEGIN ALTER TABLE ledger_fiscal_year_rollover ADD CONSTRAINT ledgerId_ledger_fkey FOREIGN KEY (ledgerId) REFERENCES ledger; EXCEPTION WHEN duplicate_object OR duplicate_table THEN NULL; END; END $$ 2020-12-14T16:44:18,092 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DO $$ BEGIN BEGIN ALTER TABLE ledger_fiscal_year_rollover ADD CONSTRAINT ledgerId_ledger_fkey FOREIGN KEY (ledgerId) REFERENCES ledger; EXCEPTION WHEN duplicate_object OR duplicate_table THEN NULL; END; END $$ 2020-12-14T16:44:18,092 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE INDEX IF NOT EXISTS ledger_fiscal_year_rollover_ledgerId_idx ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover (ledgerId) 2020-12-14T16:44:18,094 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE INDEX IF NOT EXISTS ledger_fiscal_year_rollover_ledgerId_idx ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover (ledgerId) 2020-12-14T16:44:18,094 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: INSERT INTO rmb_internal_analyze VALUES ('ledger_fiscal_year_rollover') 2020-12-14T16:44:18,095 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: INSERT INTO rmb_internal_analyze VALUES ('ledger_fiscal_year_rollover') 2020-12-14T16:44:18,095 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: ALTER TABLE finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover ADD COLUMN IF NOT EXISTS fromFiscalYearId UUID 2020-12-14T16:44:18,095 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: ALTER TABLE finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover ADD COLUMN IF NOT EXISTS fromFiscalYearId UUID 2020-12-14T16:44:18,095 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DO $$ BEGIN BEGIN ALTER TABLE ledger_fiscal_year_rollover ADD CONSTRAINT fromFiscalYearId_fiscal_year_fkey FOREIGN KEY (fromFiscalYearId) REFERENCES fiscal_year; EXCEPTION WHEN duplicate_object OR duplicate_table THEN NULL; END; END $$ 2020-12-14T16:44:18,097 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DO $$ BEGIN BEGIN ALTER TABLE ledger_fiscal_year_rollover ADD CONSTRAINT fromFiscalYearId_fiscal_year_fkey FOREIGN KEY (fromFiscalYearId) REFERENCES fiscal_year; EXCEPTION WHEN duplicate_object OR duplicate_table THEN NULL; END; END $$ 2020-12-14T16:44:18,097 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE INDEX IF NOT EXISTS ledger_fiscal_year_rollover_fromFiscalYearId_idx ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover (fromFiscalYearId) 2020-12-14T16:44:18,099 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE INDEX IF NOT EXISTS ledger_fiscal_year_rollover_fromFiscalYearId_idx ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover (fromFiscalYearId) 2020-12-14T16:44:18,099 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: INSERT INTO rmb_internal_analyze VALUES ('ledger_fiscal_year_rollover') 2020-12-14T16:44:18,099 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: INSERT INTO rmb_internal_analyze VALUES ('ledger_fiscal_year_rollover') 2020-12-14T16:44:18,099 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: ALTER TABLE finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover ADD COLUMN IF NOT EXISTS toFiscalYearId UUID 2020-12-14T16:44:18,100 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: ALTER TABLE finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover ADD COLUMN IF NOT EXISTS toFiscalYearId UUID 2020-12-14T16:44:18,100 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DO $$ BEGIN BEGIN ALTER TABLE ledger_fiscal_year_rollover ADD CONSTRAINT toFiscalYearId_fiscal_year_fkey FOREIGN KEY (toFiscalYearId) REFERENCES fiscal_year; EXCEPTION WHEN duplicate_object OR duplicate_table THEN NULL; END; END $$ 2020-12-14T16:44:18,101 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DO $$ BEGIN BEGIN ALTER TABLE ledger_fiscal_year_rollover ADD CONSTRAINT toFiscalYearId_fiscal_year_fkey FOREIGN KEY (toFiscalYearId) REFERENCES fiscal_year; EXCEPTION WHEN duplicate_object OR duplicate_table THEN NULL; END; END $$ 2020-12-14T16:44:18,101 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE INDEX IF NOT EXISTS ledger_fiscal_year_rollover_toFiscalYearId_idx ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover (toFiscalYearId) 2020-12-14T16:44:18,103 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE INDEX IF NOT EXISTS ledger_fiscal_year_rollover_toFiscalYearId_idx ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover (toFiscalYearId) 2020-12-14T16:44:18,103 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: INSERT INTO rmb_internal_analyze VALUES ('ledger_fiscal_year_rollover') 2020-12-14T16:44:18,104 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: INSERT INTO rmb_internal_analyze VALUES ('ledger_fiscal_year_rollover') 2020-12-14T16:44:18,104 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE OR REPLACE FUNCTION finance_migration_test_tenant2_mod_finance_storage.update_ledger_fiscal_year_rollover_references() RETURNS TRIGGER AS $$ BEGIN NEW.ledgerId = (NEW.jsonb->>'ledgerId'); NEW.fromFiscalYearId = (NEW.jsonb->>'fromFiscalYearId'); NEW.toFiscalYearId = (NEW.jsonb->>'toFiscalYearId'); RETURN NEW; END; $$ language 'plpgsql' 2020-12-14T16:44:18,105 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE OR REPLACE FUNCTION finance_migration_test_tenant2_mod_finance_storage.update_ledger_fiscal_year_rollover_references() RETURNS TRIGGER AS $$ BEGIN NEW.ledgerId = (NEW.jsonb->>'ledgerId'); NEW.fromFiscalYearId = (NEW.jsonb->>'fromFiscalYearId'); NEW.toFiscalYearId = (NEW.jsonb->>'toFiscalYearId'); RETURN NEW; END; $$ language 'plpgsql' 2020-12-14T16:44:18,105 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DROP TRIGGER IF EXISTS update_ledger_fiscal_year_rollover_references ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover CASCADE 2020-12-14T16:44:18,105 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DROP TRIGGER IF EXISTS update_ledger_fiscal_year_rollover_references ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover CASCADE 2020-12-14T16:44:18,105 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE TRIGGER update_ledger_fiscal_year_rollover_references BEFORE INSERT OR UPDATE ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover FOR EACH ROW EXECUTE PROCEDURE finance_migration_test_tenant2_mod_finance_storage.update_ledger_fiscal_year_rollover_references() 2020-12-14T16:44:18,106 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE TRIGGER update_ledger_fiscal_year_rollover_references BEFORE INSERT OR UPDATE ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover FOR EACH ROW EXECUTE PROCEDURE finance_migration_test_tenant2_mod_finance_storage.update_ledger_fiscal_year_rollover_references() 2020-12-14T16:44:18,106 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DO $$ DECLARE version TEXT; i INT; BEGIN SELECT jsonb->>'rmbVersion' INTO version FROM rmb_internal; IF version !~ '^(\d\.|1\d\.|2\d\.|30\.0\.)' THEN RETURN; END IF; FOR i IN 1..50 LOOP EXECUTE 'ALTER TABLE ledger_fiscal_year_rollover DROP CONSTRAINT IF EXISTS ' || 'ledgerId_ledger_fkey' || i; END LOOP; FOR i IN 1..50 LOOP EXECUTE 'ALTER TABLE ledger_fiscal_year_rollover DROP CONSTRAINT IF EXISTS ' || 'fromFiscalYearId_fiscal_year_fkey' || i; END LOOP; FOR i IN 1..50 LOOP EXECUTE 'ALTER TABLE ledger_fiscal_year_rollover DROP CONSTRAINT IF EXISTS ' || 'toFiscalYearId_fiscal_year_fkey' || i; END LOOP; END $$ 2020-12-14T16:44:18,107 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DO $$ DECLARE version TEXT; i INT; BEGIN SELECT jsonb->>'rmbVersion' INTO version FROM rmb_internal; IF version !~ '^(\d\.|1\d\.|2\d\.|30\.0\.)' THEN RETURN; END IF; FOR i IN 1..50 LOOP EXECUTE 'ALTER TABLE ledger_fiscal_year_rollover DROP CONSTRAINT IF EXISTS ' || 'ledgerId_ledger_fkey' || i; END LOOP; FO 2020-12-14T16:44:18,107 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE OR REPLACE FUNCTION finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_set_md() RETURNS TRIGGER AS $$ DECLARE input text; createdDate timestamp; BEGIN input = NEW.jsonb->'metadata'->>'createdDate'; IF input IS NULL THEN RETURN NEW; END IF; -- time stamp without time zone? IF (input::timestamp::timestamptz = input::timestamptz) THEN -- createdDate already has no time zone, normalize using ::timestamp createdDate = input::timestamp; ELSE -- createdDate has a time zone string -- normalize using ::timestamptz, convert to '+00' time zone and remove time zone string createdDate = input::timestamptz AT TIME ZONE '+00'; END IF; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdDate}', to_jsonb(createdDate)); NEW.creation_date = createdDate; NEW.created_by = NEW.jsonb->'metadata'->>'createdByUserId'; RETURN NEW; END; $$ language 'plpgsql' 2020-12-14T16:44:18,108 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE OR REPLACE FUNCTION finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_set_md() RETURNS TRIGGER AS $$ DECLARE input text; createdDate timestamp; BEGIN input = NEW.jsonb->'metadata'->>'createdDate'; IF input IS NULL THEN RETURN NEW; END IF; -- time stamp without time zone? IF (input::timestamp::timestamptz = input::timestamptz) THEN -- creat 2020-12-14T16:44:18,108 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DROP TRIGGER IF EXISTS set_ledger_fiscal_year_rollover_md_trigger ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover CASCADE 2020-12-14T16:44:18,108 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DROP TRIGGER IF EXISTS set_ledger_fiscal_year_rollover_md_trigger ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover CASCADE 2020-12-14T16:44:18,108 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE TRIGGER set_ledger_fiscal_year_rollover_md_trigger BEFORE INSERT ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover FOR EACH ROW EXECUTE PROCEDURE finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_set_md() 2020-12-14T16:44:18,109 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE TRIGGER set_ledger_fiscal_year_rollover_md_trigger BEFORE INSERT ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover FOR EACH ROW EXECUTE PROCEDURE finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_set_md() 2020-12-14T16:44:18,109 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE OR REPLACE FUNCTION finance_migration_test_tenant2_mod_finance_storage.set_ledger_fiscal_year_rollover_md_json() RETURNS TRIGGER AS $$ BEGIN if NEW.creation_date IS NULL then RETURN NEW; end if; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdDate}', to_jsonb(NEW.creation_date)); if NEW.created_by IS NULL then NEW.jsonb = NEW.jsonb #- '{metadata,createdByUserId}'; else NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdByUserId}', to_jsonb(NEW.created_by)); end if; RETURN NEW; END; $$ language 'plpgsql' 2020-12-14T16:44:18,109 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE OR REPLACE FUNCTION finance_migration_test_tenant2_mod_finance_storage.set_ledger_fiscal_year_rollover_md_json() RETURNS TRIGGER AS $$ BEGIN if NEW.creation_date IS NULL then RETURN NEW; end if; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdDate}', to_jsonb(NEW.creation_date)); if NEW.created_by IS NULL then NEW.jsonb = NEW.jsonb #- '{metadata,createdByUserId}'; els 2020-12-14T16:44:18,110 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DROP TRIGGER IF EXISTS set_ledger_fiscal_year_rollover_md_json_trigger ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover CASCADE 2020-12-14T16:44:18,110 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DROP TRIGGER IF EXISTS set_ledger_fiscal_year_rollover_md_json_trigger ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover CASCADE 2020-12-14T16:44:18,110 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE TRIGGER set_ledger_fiscal_year_rollover_md_json_trigger BEFORE UPDATE ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover FOR EACH ROW EXECUTE PROCEDURE finance_migration_test_tenant2_mod_finance_storage.set_ledger_fiscal_year_rollover_md_json() 2020-12-14T16:44:18,110 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE TRIGGER set_ledger_fiscal_year_rollover_md_json_trigger BEFORE UPDATE ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover FOR EACH ROW EXECUTE PROCEDURE finance_migration_test_tenant2_mod_finance_storage.set_ledger_fiscal_year_rollover_md_json() 2020-12-14T16:44:18,111 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE TABLE IF NOT EXISTS finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress ( id UUID PRIMARY KEY, jsonb JSONB NOT NULL ) 2020-12-14T16:44:18,115 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE TABLE IF NOT EXISTS finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress ( id UUID PRIMARY KEY, jsonb JSONB NOT NULL ) 2020-12-14T16:44:18,115 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DROP TRIGGER IF EXISTS set_id_injson_ledger_fiscal_year_rollover_progress ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress CASCADE 2020-12-14T16:44:18,116 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DROP TRIGGER IF EXISTS set_id_injson_ledger_fiscal_year_rollover_progress ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress CASCADE 2020-12-14T16:44:18,116 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DROP TRIGGER IF EXISTS set_id_in_jsonb ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress CASCADE 2020-12-14T16:44:18,116 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DROP TRIGGER IF EXISTS set_id_in_jsonb ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress CASCADE 2020-12-14T16:44:18,116 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE TRIGGER set_id_in_jsonb BEFORE INSERT OR UPDATE ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress FOR EACH ROW EXECUTE PROCEDURE finance_migration_test_tenant2_mod_finance_storage.set_id_in_jsonb() 2020-12-14T16:44:18,117 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE TRIGGER set_id_in_jsonb BEFORE INSERT OR UPDATE ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress FOR EACH ROW EXECUTE PROCEDURE finance_migration_test_tenant2_mod_finance_storage.set_id_in_jsonb() 2020-12-14T16:44:18,117 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: ALTER TABLE finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress ADD COLUMN IF NOT EXISTS creation_date timestamp, ADD COLUMN IF NOT EXISTS created_by text 2020-12-14T16:44:18,117 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: ALTER TABLE finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress ADD COLUMN IF NOT EXISTS creation_date timestamp, ADD COLUMN IF NOT EXISTS created_by text 2020-12-14T16:44:18,117 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DO $do$ BEGIN PERFORM rmb_internal_index( 'ledger_fiscal_year_rollover_progress', 'ledger_fiscal_year_rollover_progress_overallRolloverStatus_idx', 'ADD', 'CREATE INDEX IF NOT EXISTS ledger_fiscal_year_rollover_progress_overallRolloverStatus_idx ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress ' || $rmb$(left(lower(f_unaccent(jsonb->>'overallRolloverStatus')),600))$rmb$ ); END $do$ 2020-12-14T16:44:18,119 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DO $do$ BEGIN PERFORM rmb_internal_index( 'ledger_fiscal_year_rollover_progress', 'ledger_fiscal_year_rollover_progress_overallRolloverStatus_idx', 'ADD', 'CREATE INDEX IF NOT EXISTS ledger_fiscal_year_rollover_progress_overallRolloverStatus_idx ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress ' || $rmb$(left(lower(f_unacce 2020-12-14T16:44:18,120 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: ALTER TABLE finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress ADD COLUMN IF NOT EXISTS ledgerRolloverId UUID 2020-12-14T16:44:18,120 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: ALTER TABLE finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress ADD COLUMN IF NOT EXISTS ledgerRolloverId UUID 2020-12-14T16:44:18,120 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DO $$ BEGIN BEGIN ALTER TABLE ledger_fiscal_year_rollover_progress ADD CONSTRAINT ledgerRolloverId_ledger_fiscal_year_rollover_fkey FOREIGN KEY (ledgerRolloverId) REFERENCES ledger_fiscal_year_rollover; EXCEPTION WHEN duplicate_object OR duplicate_table THEN NULL; END; END $$ 2020-12-14T16:44:18,122 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DO $$ BEGIN BEGIN ALTER TABLE ledger_fiscal_year_rollover_progress ADD CONSTRAINT ledgerRolloverId_ledger_fiscal_year_rollover_fkey FOREIGN KEY (ledgerRolloverId) REFERENCES ledger_fiscal_year_rollover; EXCEPTION WHEN duplicate_object OR duplicate_table THEN NULL; END; END $$ 2020-12-14T16:44:18,122 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE INDEX IF NOT EXISTS ledger_fiscal_year_rollover_progress_ledgerRolloverId_idx ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress (ledgerRolloverId) 2020-12-14T16:44:18,124 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE INDEX IF NOT EXISTS ledger_fiscal_year_rollover_progress_ledgerRolloverId_idx ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress (ledgerRolloverId) 2020-12-14T16:44:18,124 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: INSERT INTO rmb_internal_analyze VALUES ('ledger_fiscal_year_rollover_progress') 2020-12-14T16:44:18,124 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: INSERT INTO rmb_internal_analyze VALUES ('ledger_fiscal_year_rollover_progress') 2020-12-14T16:44:18,125 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE OR REPLACE FUNCTION finance_migration_test_tenant2_mod_finance_storage.update_ledger_fiscal_year_rollover_progress_references() RETURNS TRIGGER AS $$ BEGIN NEW.ledgerRolloverId = (NEW.jsonb->>'ledgerRolloverId'); RETURN NEW; END; $$ language 'plpgsql' 2020-12-14T16:44:18,125 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE OR REPLACE FUNCTION finance_migration_test_tenant2_mod_finance_storage.update_ledger_fiscal_year_rollover_progress_references() RETURNS TRIGGER AS $$ BEGIN NEW.ledgerRolloverId = (NEW.jsonb->>'ledgerRolloverId'); RETURN NEW; END; $$ language 'plpgsql' 2020-12-14T16:44:18,125 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DROP TRIGGER IF EXISTS update_ledger_fiscal_year_rollover_progress_references ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress CASCADE 2020-12-14T16:44:18,125 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DROP TRIGGER IF EXISTS update_ledger_fiscal_year_rollover_progress_references ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress CASCADE 2020-12-14T16:44:18,126 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE TRIGGER update_ledger_fiscal_year_rollover_progress_references BEFORE INSERT OR UPDATE ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress FOR EACH ROW EXECUTE PROCEDURE finance_migration_test_tenant2_mod_finance_storage.update_ledger_fiscal_year_rollover_progress_references() 2020-12-14T16:44:18,126 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE TRIGGER update_ledger_fiscal_year_rollover_progress_references BEFORE INSERT OR UPDATE ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress FOR EACH ROW EXECUTE PROCEDURE finance_migration_test_tenant2_mod_finance_storage.update_ledger_fiscal_year_rollover_progress_references() 2020-12-14T16:44:18,126 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DO $$ DECLARE version TEXT; i INT; BEGIN SELECT jsonb->>'rmbVersion' INTO version FROM rmb_internal; IF version !~ '^(\d\.|1\d\.|2\d\.|30\.0\.)' THEN RETURN; END IF; FOR i IN 1..50 LOOP EXECUTE 'ALTER TABLE ledger_fiscal_year_rollover_progress DROP CONSTRAINT IF EXISTS ' || 'ledgerRolloverId_ledger_fiscal_year_rollover_fkey' || i; END LOOP; END $$ 2020-12-14T16:44:18,127 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DO $$ DECLARE version TEXT; i INT; BEGIN SELECT jsonb->>'rmbVersion' INTO version FROM rmb_internal; IF version !~ '^(\d\.|1\d\.|2\d\.|30\.0\.)' THEN RETURN; END IF; FOR i IN 1..50 LOOP EXECUTE 'ALTER TABLE ledger_fiscal_year_rollover_progress DROP CONSTRAINT IF EXISTS ' || 'ledgerRolloverId_ledger_fiscal_year_rollove 2020-12-14T16:44:18,127 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE OR REPLACE FUNCTION finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress_set_md() RETURNS TRIGGER AS $$ DECLARE input text; createdDate timestamp; BEGIN input = NEW.jsonb->'metadata'->>'createdDate'; IF input IS NULL THEN RETURN NEW; END IF; -- time stamp without time zone? IF (input::timestamp::timestamptz = input::timestamptz) THEN -- createdDate already has no time zone, normalize using ::timestamp createdDate = input::timestamp; ELSE -- createdDate has a time zone string -- normalize using ::timestamptz, convert to '+00' time zone and remove time zone string createdDate = input::timestamptz AT TIME ZONE '+00'; END IF; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdDate}', to_jsonb(createdDate)); NEW.creation_date = createdDate; NEW.created_by = NEW.jsonb->'metadata'->>'createdByUserId'; RETURN NEW; END; $$ language 'plpgsql' 2020-12-14T16:44:18,127 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE OR REPLACE FUNCTION finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress_set_md() RETURNS TRIGGER AS $$ DECLARE input text; createdDate timestamp; BEGIN input = NEW.jsonb->'metadata'->>'createdDate'; IF input IS NULL THEN RETURN NEW; END IF; -- time stamp without time zone? IF (input::timestamp::timestamptz = input::timestamptz) THEN 2020-12-14T16:44:18,128 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DROP TRIGGER IF EXISTS set_ledger_fiscal_year_rollover_progress_md_trigger ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress CASCADE 2020-12-14T16:44:18,128 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DROP TRIGGER IF EXISTS set_ledger_fiscal_year_rollover_progress_md_trigger ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress CASCADE 2020-12-14T16:44:18,128 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE TRIGGER set_ledger_fiscal_year_rollover_progress_md_trigger BEFORE INSERT ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress FOR EACH ROW EXECUTE PROCEDURE finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress_set_md() 2020-12-14T16:44:18,128 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE TRIGGER set_ledger_fiscal_year_rollover_progress_md_trigger BEFORE INSERT ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress FOR EACH ROW EXECUTE PROCEDURE finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress_set_md() 2020-12-14T16:44:18,128 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE OR REPLACE FUNCTION finance_migration_test_tenant2_mod_finance_storage.set_ledger_fiscal_year_rollover_progress_md_json() RETURNS TRIGGER AS $$ BEGIN if NEW.creation_date IS NULL then RETURN NEW; end if; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdDate}', to_jsonb(NEW.creation_date)); if NEW.created_by IS NULL then NEW.jsonb = NEW.jsonb #- '{metadata,createdByUserId}'; else NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdByUserId}', to_jsonb(NEW.created_by)); end if; RETURN NEW; END; $$ language 'plpgsql' 2020-12-14T16:44:18,129 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE OR REPLACE FUNCTION finance_migration_test_tenant2_mod_finance_storage.set_ledger_fiscal_year_rollover_progress_md_json() RETURNS TRIGGER AS $$ BEGIN if NEW.creation_date IS NULL then RETURN NEW; end if; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdDate}', to_jsonb(NEW.creation_date)); if NEW.created_by IS NULL then NEW.jsonb = NEW.jsonb #- '{metadata,createdByUserId 2020-12-14T16:44:18,129 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DROP TRIGGER IF EXISTS set_ledger_fiscal_year_rollover_progress_md_json_trigger ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress CASCADE 2020-12-14T16:44:18,129 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DROP TRIGGER IF EXISTS set_ledger_fiscal_year_rollover_progress_md_json_trigger ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress CASCADE 2020-12-14T16:44:18,129 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE TRIGGER set_ledger_fiscal_year_rollover_progress_md_json_trigger BEFORE UPDATE ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress FOR EACH ROW EXECUTE PROCEDURE finance_migration_test_tenant2_mod_finance_storage.set_ledger_fiscal_year_rollover_progress_md_json() 2020-12-14T16:44:18,129 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE TRIGGER set_ledger_fiscal_year_rollover_progress_md_json_trigger BEFORE UPDATE ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_progress FOR EACH ROW EXECUTE PROCEDURE finance_migration_test_tenant2_mod_finance_storage.set_ledger_fiscal_year_rollover_progress_md_json() 2020-12-14T16:44:18,129 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE TABLE IF NOT EXISTS finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error ( id UUID PRIMARY KEY, jsonb JSONB NOT NULL ) 2020-12-14T16:44:18,133 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE TABLE IF NOT EXISTS finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error ( id UUID PRIMARY KEY, jsonb JSONB NOT NULL ) 2020-12-14T16:44:18,134 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DROP TRIGGER IF EXISTS set_id_injson_ledger_fiscal_year_rollover_error ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error CASCADE 2020-12-14T16:44:18,134 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DROP TRIGGER IF EXISTS set_id_injson_ledger_fiscal_year_rollover_error ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error CASCADE 2020-12-14T16:44:18,134 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DROP TRIGGER IF EXISTS set_id_in_jsonb ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error CASCADE 2020-12-14T16:44:18,134 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DROP TRIGGER IF EXISTS set_id_in_jsonb ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error CASCADE 2020-12-14T16:44:18,134 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE TRIGGER set_id_in_jsonb BEFORE INSERT OR UPDATE ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error FOR EACH ROW EXECUTE PROCEDURE finance_migration_test_tenant2_mod_finance_storage.set_id_in_jsonb() 2020-12-14T16:44:18,135 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE TRIGGER set_id_in_jsonb BEFORE INSERT OR UPDATE ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error FOR EACH ROW EXECUTE PROCEDURE finance_migration_test_tenant2_mod_finance_storage.set_id_in_jsonb() 2020-12-14T16:44:18,135 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: ALTER TABLE finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error ADD COLUMN IF NOT EXISTS creation_date timestamp, ADD COLUMN IF NOT EXISTS created_by text 2020-12-14T16:44:18,135 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: ALTER TABLE finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error ADD COLUMN IF NOT EXISTS creation_date timestamp, ADD COLUMN IF NOT EXISTS created_by text 2020-12-14T16:44:18,135 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DO $do$ BEGIN PERFORM rmb_internal_index( 'ledger_fiscal_year_rollover_error', 'ledger_fiscal_year_rollover_error_details_purchaseOrderId_idx', 'ADD', 'CREATE INDEX IF NOT EXISTS ledger_fiscal_year_rollover_error_details_purchaseOrderId_idx ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error ' || $rmb$(left(lower(f_unaccent(jsonb->'details'->>'purchaseOrderId')),600))$rmb$ ); END $do$ 2020-12-14T16:44:18,138 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DO $do$ BEGIN PERFORM rmb_internal_index( 'ledger_fiscal_year_rollover_error', 'ledger_fiscal_year_rollover_error_details_purchaseOrderId_idx', 'ADD', 'CREATE INDEX IF NOT EXISTS ledger_fiscal_year_rollover_error_details_purchaseOrderId_idx ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error ' || $rmb$(left(lower(f_unaccent(jsonb 2020-12-14T16:44:18,138 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DO $do$ BEGIN PERFORM rmb_internal_index( 'ledger_fiscal_year_rollover_error', 'ledger_fiscal_year_rollover_error_details_fundId_idx', 'ADD', 'CREATE INDEX IF NOT EXISTS ledger_fiscal_year_rollover_error_details_fundId_idx ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error ' || $rmb$(left(lower(f_unaccent(jsonb->'details'->>'fundId')),600))$rmb$ ); END $do$ 2020-12-14T16:44:18,142 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DO $do$ BEGIN PERFORM rmb_internal_index( 'ledger_fiscal_year_rollover_error', 'ledger_fiscal_year_rollover_error_details_fundId_idx', 'ADD', 'CREATE INDEX IF NOT EXISTS ledger_fiscal_year_rollover_error_details_fundId_idx ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error ' || $rmb$(left(lower(f_unaccent(jsonb->'details'->>'fun 2020-12-14T16:44:18,142 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: ALTER TABLE finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error ADD COLUMN IF NOT EXISTS ledgerRolloverId UUID 2020-12-14T16:44:18,143 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: ALTER TABLE finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error ADD COLUMN IF NOT EXISTS ledgerRolloverId UUID 2020-12-14T16:44:18,143 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DO $$ BEGIN BEGIN ALTER TABLE ledger_fiscal_year_rollover_error ADD CONSTRAINT ledgerRolloverId_ledger_fiscal_year_rollover_fkey FOREIGN KEY (ledgerRolloverId) REFERENCES ledger_fiscal_year_rollover; EXCEPTION WHEN duplicate_object OR duplicate_table THEN NULL; END; END $$ 2020-12-14T16:44:18,144 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DO $$ BEGIN BEGIN ALTER TABLE ledger_fiscal_year_rollover_error ADD CONSTRAINT ledgerRolloverId_ledger_fiscal_year_rollover_fkey FOREIGN KEY (ledgerRolloverId) REFERENCES ledger_fiscal_year_rollover; EXCEPTION WHEN duplicate_object OR duplicate_table THEN NULL; END; END $$ 2020-12-14T16:44:18,144 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE INDEX IF NOT EXISTS ledger_fiscal_year_rollover_error_ledgerRolloverId_idx ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error (ledgerRolloverId) 2020-12-14T16:44:18,146 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE INDEX IF NOT EXISTS ledger_fiscal_year_rollover_error_ledgerRolloverId_idx ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error (ledgerRolloverId) 2020-12-14T16:44:18,146 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: INSERT INTO rmb_internal_analyze VALUES ('ledger_fiscal_year_rollover_error') 2020-12-14T16:44:18,147 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: INSERT INTO rmb_internal_analyze VALUES ('ledger_fiscal_year_rollover_error') 2020-12-14T16:44:18,147 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE OR REPLACE FUNCTION finance_migration_test_tenant2_mod_finance_storage.update_ledger_fiscal_year_rollover_error_references() RETURNS TRIGGER AS $$ BEGIN NEW.ledgerRolloverId = (NEW.jsonb->>'ledgerRolloverId'); RETURN NEW; END; $$ language 'plpgsql' 2020-12-14T16:44:18,147 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE OR REPLACE FUNCTION finance_migration_test_tenant2_mod_finance_storage.update_ledger_fiscal_year_rollover_error_references() RETURNS TRIGGER AS $$ BEGIN NEW.ledgerRolloverId = (NEW.jsonb->>'ledgerRolloverId'); RETURN NEW; END; $$ language 'plpgsql' 2020-12-14T16:44:18,147 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DROP TRIGGER IF EXISTS update_ledger_fiscal_year_rollover_error_references ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error CASCADE 2020-12-14T16:44:18,147 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DROP TRIGGER IF EXISTS update_ledger_fiscal_year_rollover_error_references ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error CASCADE 2020-12-14T16:44:18,147 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE TRIGGER update_ledger_fiscal_year_rollover_error_references BEFORE INSERT OR UPDATE ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error FOR EACH ROW EXECUTE PROCEDURE finance_migration_test_tenant2_mod_finance_storage.update_ledger_fiscal_year_rollover_error_references() 2020-12-14T16:44:18,148 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE TRIGGER update_ledger_fiscal_year_rollover_error_references BEFORE INSERT OR UPDATE ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error FOR EACH ROW EXECUTE PROCEDURE finance_migration_test_tenant2_mod_finance_storage.update_ledger_fiscal_year_rollover_error_references() 2020-12-14T16:44:18,148 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DO $$ DECLARE version TEXT; i INT; BEGIN SELECT jsonb->>'rmbVersion' INTO version FROM rmb_internal; IF version !~ '^(\d\.|1\d\.|2\d\.|30\.0\.)' THEN RETURN; END IF; FOR i IN 1..50 LOOP EXECUTE 'ALTER TABLE ledger_fiscal_year_rollover_error DROP CONSTRAINT IF EXISTS ' || 'ledgerRolloverId_ledger_fiscal_year_rollover_fkey' || i; END LOOP; END $$ 2020-12-14T16:44:18,148 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DO $$ DECLARE version TEXT; i INT; BEGIN SELECT jsonb->>'rmbVersion' INTO version FROM rmb_internal; IF version !~ '^(\d\.|1\d\.|2\d\.|30\.0\.)' THEN RETURN; END IF; FOR i IN 1..50 LOOP EXECUTE 'ALTER TABLE ledger_fiscal_year_rollover_error DROP CONSTRAINT IF EXISTS ' || 'ledgerRolloverId_ledger_fiscal_year_rollover_f 2020-12-14T16:44:18,148 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE OR REPLACE FUNCTION finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error_set_md() RETURNS TRIGGER AS $$ DECLARE input text; createdDate timestamp; BEGIN input = NEW.jsonb->'metadata'->>'createdDate'; IF input IS NULL THEN RETURN NEW; END IF; -- time stamp without time zone? IF (input::timestamp::timestamptz = input::timestamptz) THEN -- createdDate already has no time zone, normalize using ::timestamp createdDate = input::timestamp; ELSE -- createdDate has a time zone string -- normalize using ::timestamptz, convert to '+00' time zone and remove time zone string createdDate = input::timestamptz AT TIME ZONE '+00'; END IF; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdDate}', to_jsonb(createdDate)); NEW.creation_date = createdDate; NEW.created_by = NEW.jsonb->'metadata'->>'createdByUserId'; RETURN NEW; END; $$ language 'plpgsql' 2020-12-14T16:44:18,149 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE OR REPLACE FUNCTION finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error_set_md() RETURNS TRIGGER AS $$ DECLARE input text; createdDate timestamp; BEGIN input = NEW.jsonb->'metadata'->>'createdDate'; IF input IS NULL THEN RETURN NEW; END IF; -- time stamp without time zone? IF (input::timestamp::timestamptz = input::timestamptz) THEN -- 2020-12-14T16:44:18,149 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DROP TRIGGER IF EXISTS set_ledger_fiscal_year_rollover_error_md_trigger ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error CASCADE 2020-12-14T16:44:18,150 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DROP TRIGGER IF EXISTS set_ledger_fiscal_year_rollover_error_md_trigger ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error CASCADE 2020-12-14T16:44:18,150 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE TRIGGER set_ledger_fiscal_year_rollover_error_md_trigger BEFORE INSERT ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error FOR EACH ROW EXECUTE PROCEDURE finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error_set_md() 2020-12-14T16:44:18,150 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE TRIGGER set_ledger_fiscal_year_rollover_error_md_trigger BEFORE INSERT ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error FOR EACH ROW EXECUTE PROCEDURE finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error_set_md() 2020-12-14T16:44:18,150 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE OR REPLACE FUNCTION finance_migration_test_tenant2_mod_finance_storage.set_ledger_fiscal_year_rollover_error_md_json() RETURNS TRIGGER AS $$ BEGIN if NEW.creation_date IS NULL then RETURN NEW; end if; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdDate}', to_jsonb(NEW.creation_date)); if NEW.created_by IS NULL then NEW.jsonb = NEW.jsonb #- '{metadata,createdByUserId}'; else NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdByUserId}', to_jsonb(NEW.created_by)); end if; RETURN NEW; END; $$ language 'plpgsql' 2020-12-14T16:44:18,151 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE OR REPLACE FUNCTION finance_migration_test_tenant2_mod_finance_storage.set_ledger_fiscal_year_rollover_error_md_json() RETURNS TRIGGER AS $$ BEGIN if NEW.creation_date IS NULL then RETURN NEW; end if; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdDate}', to_jsonb(NEW.creation_date)); if NEW.created_by IS NULL then NEW.jsonb = NEW.jsonb #- '{metadata,createdByUserId}'; 2020-12-14T16:44:18,151 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DROP TRIGGER IF EXISTS set_ledger_fiscal_year_rollover_error_md_json_trigger ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error CASCADE 2020-12-14T16:44:18,151 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DROP TRIGGER IF EXISTS set_ledger_fiscal_year_rollover_error_md_json_trigger ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error CASCADE 2020-12-14T16:44:18,151 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: CREATE TRIGGER set_ledger_fiscal_year_rollover_error_md_json_trigger BEFORE UPDATE ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error FOR EACH ROW EXECUTE PROCEDURE finance_migration_test_tenant2_mod_finance_storage.set_ledger_fiscal_year_rollover_error_md_json() 2020-12-14T16:44:18,152 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: CREATE TRIGGER set_ledger_fiscal_year_rollover_error_md_json_trigger BEFORE UPDATE ON finance_migration_test_tenant2_mod_finance_storage.ledger_fiscal_year_rollover_error FOR EACH ROW EXECUTE PROCEDURE finance_migration_test_tenant2_mod_finance_storage.set_ledger_fiscal_year_rollover_error_md_json() 2020-12-14T16:44:18,152 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: UPDATE finance_migration_test_tenant2_mod_finance_storage.transaction SET jsonb = jsonb_set(jsonb, '{encumbrance, reEncumber}', 'true', false) WHERE jsonb ? 'encumbrance' AND (jsonb::json -> 'encumbrance' ->> 'reEncumber')::boolean <> true 2020-12-14T16:44:18,159 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: UPDATE finance_migration_test_tenant2_mod_finance_storage.transaction SET jsonb = jsonb_set(jsonb, '{encumbrance, reEncumber}', 'true', false) WHERE jsonb ? 'encumbrance' AND (jsonb::json -> 'encumbrance' ->> 'reEncumber')::boolean <> true 2020-12-14T16:44:18,159 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DO $$ DECLARE aname TEXT; BEGIN FOR aname IN SELECT name FROM finance_migration_test_tenant2_mod_finance_storage.rmb_internal_index WHERE remove = TRUE LOOP EXECUTE 'DROP INDEX IF EXISTS ' || aname; END LOOP; END $$ 2020-12-14T16:44:18,159 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DO $$ DECLARE aname TEXT; BEGIN FOR aname IN SELECT name FROM finance_migration_test_tenant2_mod_finance_storage.rmb_internal_index WHERE remove = TRUE LOOP EXECUTE 'DROP INDEX IF EXISTS ' || aname; END LOOP; END $$ 2020-12-14T16:44:18,159 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DO $$ DECLARE version TEXT; i RECORD; newindexdef TEXT; BEGIN SELECT jsonb->>'rmbVersion' INTO version FROM finance_migration_test_tenant2_mod_finance_storage.rmb_internal; IF version !~ '^(\d\.|1\d\.|2[0-8]\.|29\.[0-3]\.)' THEN -- skip this upgrade if last install/upgrade was made by RMB >= 29.4.x RETURN; END IF; FOR i IN SELECT * FROM pg_catalog.pg_indexes WHERE schemaname = 'finance_migration_test_tenant2_mod_finance_storage' LOOP newindexdef := regexp_replace(i.indexdef, -- \m = beginning of a word, \M = end of a word '\mpublic\.(f_unaccent|concat_space_sql|concat_array_object_values|concat_array_object)\M', 'finance_migration_test_tenant2_mod_finance_storage.\1', 'g'); IF newindexdef <> i.indexdef THEN EXECUTE 'DROP INDEX ' || i.indexname; EXECUTE newindexdef; EXECUTE 'INSERT INTO rmb_internal_analyze VALUES ($1)' USING i.tablename; END IF; END LOOP; END $$ 2020-12-14T16:44:18,160 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DO $$ DECLARE version TEXT; i RECORD; newindexdef TEXT; BEGIN SELECT jsonb->>'rmbVersion' INTO version FROM finance_migration_test_tenant2_mod_finance_storage.rmb_internal; IF version !~ '^(\d\.|1\d\.|2[0-8]\.|29\.[0-3]\.)' THEN -- skip this upgrade if last install/upgrade was made by RMB >= 29.4.x RETURN; END IF; FOR i IN SELECT * FROM pg_catalog.pg_indexes WHERE schemaname 2020-12-14T16:44:18,160 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: DO $$ DECLARE t TEXT; BEGIN FOR t IN SELECT DISTINCT tablename FROM rmb_internal_analyze LOOP EXECUTE 'ANALYZE ' || t; END LOOP; END $$ 2020-12-14T16:44:18,167 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: DO $$ DECLARE t TEXT; BEGIN FOR t IN SELECT DISTINCT tablename FROM rmb_internal_analyze LOOP EXECUTE 'ANALYZE ' || t; END LOOP; END $$ 2020-12-14T16:44:18,168 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: TRUNCATE rmb_internal_analyze 2020-12-14T16:44:18,173 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: TRUNCATE rmb_internal_analyze 2020-12-14T16:44:18,174 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA finance_migration_test_tenant2_mod_finance_storage TO finance_migration_test_tenant2_mod_finance_storage 2020-12-14T16:44:18,175 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA finance_migration_test_tenant2_mod_finance_storage TO finance_migration_test_tenant2_mod_finance_storage 2020-12-14T16:44:18,175 INFO [vert.x-worker-thread-1 ] PostgresClient trying to execute: UPDATE finance_migration_test_tenant2_mod_finance_storage.rmb_internal SET jsonb = jsonb || jsonb_build_object( 'rmbVersion', '31.1.5', 'moduleVersion', 'mod-finance-storage-6.1.0', 'schemaJson', $mainftl${ "scripts": [ { "run": "after", "snippetPath": "group_budget_view.sql", "fromModuleVersion": "mod-finance-storage-4.0.0" }, { "run": "after", "snippetPath": "migration/transaction.sql", "fromModuleVersion": "mod-finance-storage-4.0.0" }, { "run": "after", "snippetPath": "migration/ledgers.sql", "fromModuleVersion": "mod-finance-storage-4.0.0" }, { "run": "after", "snippetPath": "migration/funds.sql", "fromModuleVersion": "mod-finance-storage-4.0.0" }, { "run": "after", "snippetPath": "migration/fiscal_years.sql", "fromModuleVersion": "mod-finance-storage-4.0.0" }, { "run": "after", "snippetPath": "migration/budgets.sql", 2020-12-14T16:44:18,179 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully executed: UPDATE finance_migration_test_tenant2_mod_finance_storage.rmb_internal SET jsonb = jsonb || jsonb_build_object( 'rmbVersion', '31.1.5', 'moduleVersion', 'mod-finance-storage-6.1.0', 'schemaJson', $mainftl${ "scripts": [ { "run": "after", "snippetPath": "group_budget_view.sql", "fromModuleVersion": "mod-finance-storage-4.0.0" }, { "run": "after", 2020-12-14T16:44:18,181 INFO [vert.x-worker-thread-1 ] PostgresClient Successfully committed: 825872929 2020-12-14T16:44:18,238 INFO [vert.x-eventloop-thread-0] LogUtil org.folio.rest.RestVerticle start invoking postTenant 2020-12-14T16:44:18,250 INFO [vert.x-eventloop-thread-0] LogUtil 10.0.2.15:57898 POST /_/tenant null HTTP_1_1 200 2 2054 tid=finance_migration_test_tenant2 OK