diff --git a/application/src/main/resources/db/migration/ledgersync/V1_1_1__init-schema.sql b/application/src/main/resources/db/migration/ledgersync/V1_1_1__init-schema.sql index 00b3f5eb..b3ff1fe2 100644 --- a/application/src/main/resources/db/migration/ledgersync/V1_1_1__init-schema.sql +++ b/application/src/main/resources/db/migration/ledgersync/V1_1_1__init-schema.sql @@ -704,7 +704,8 @@ CREATE TABLE IF NOT EXISTS address balance numeric(39) NOT NULL, tx_count bigint, stake_address_id bigint, - verified_contract boolean + verified_contract boolean, + payment_cred varchar(56) ); -- diff --git a/application/src/main/resources/db/migration/ledgersync/V1_1_3__create-index.sql b/application/src/main/resources/db/migration/ledgersync/V1_1_3__create-index.sql index 8f11de85..72d71fce 100644 --- a/application/src/main/resources/db/migration/ledgersync/V1_1_3__create-index.sql +++ b/application/src/main/resources/db/migration/ledgersync/V1_1_3__create-index.sql @@ -179,3 +179,7 @@ CREATE INDEX IF NOT EXISTS tx_witnesses_tx_id_idx ON tx_witnesses (tx_id); CREATE INDEX IF NOT EXISTS tx_bootstrap_witnesses_tx_id_idx ON tx_bootstrap_witnesses (tx_id); CREATE INDEX IF NOT EXISTS redeemer_script_hash_idx ON redeemer (script_hash); + +CREATE INDEX IF NOT EXISTS address_payment_cred_idx ON address (payment_cred); +CREATE INDEX IF NOT EXISTS redeemer_script_hash_tx_id_idx ON redeemer (script_hash, tx_id); +CREATE INDEX IF NOT EXISTS stake_address_script_hash_idx ON stake_address (script_hash); \ No newline at end of file diff --git a/application/src/main/resources/db/migration/ledgersync/V1_1_5__add_payment_cert_column_in_address_table.sql b/application/src/main/resources/db/migration/ledgersync/V1_1_5__add_payment_cert_column_in_address_table.sql deleted file mode 100644 index 43d8a8ac..00000000 --- a/application/src/main/resources/db/migration/ledgersync/V1_1_5__add_payment_cert_column_in_address_table.sql +++ /dev/null @@ -1,12 +0,0 @@ -ALTER TABLE address - ADD COLUMN IF NOT EXISTS payment_cred varchar (56) NULL; - -UPDATE address -SET payment_cred = (SELECT txo.payment_cred - FROM tx_out txo - WHERE txo.address = address.address LIMIT 1) -WHERE address.address_has_script IS TRUE; - -CREATE INDEX IF NOT EXISTS address_payment_cred_idx ON address (payment_cred); -CREATE INDEX IF NOT EXISTS redeemer_script_hash_tx_id_idx ON redeemer (script_hash, tx_id); -CREATE INDEX IF NOT EXISTS stake_address_script_hash_idx ON stake_address (script_hash); \ No newline at end of file