-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: migration, add down.sql content
- Loading branch information
1 parent
8f3de5d
commit 4b77d6f
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
migrations/2023-11-08-144951_drop_connector_response_table/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,34 @@ | ||
-- This file should undo anything in `up.sql` | ||
CREATE TABLE connector_response ( | ||
id SERIAL PRIMARY KEY, | ||
payment_id VARCHAR(255) NOT NULL, | ||
merchant_id VARCHAR(255) NOT NULL, | ||
txn_id VARCHAR(255) NOT NULL, | ||
created_at TIMESTAMP NOT NULL DEFAULT now()::TIMESTAMP, | ||
modified_at TIMESTAMP NOT NULL DEFAULT now()::TIMESTAMP, | ||
connector_name VARCHAR(32) NOT NULL, | ||
connector_transaction_id VARCHAR(255), | ||
authentication_data JSON, | ||
encoded_data TEXT | ||
); | ||
|
||
CREATE UNIQUE INDEX connector_response_id_index ON connector_response (payment_id, merchant_id, txn_id); | ||
|
||
ALTER TABLE connector_response ALTER COLUMN connector_name DROP NOT NULL; | ||
ALTER TABLE connector_response RENAME COLUMN txn_id TO attempt_id; | ||
ALTER TABLE connector_response | ||
ALTER COLUMN payment_id TYPE VARCHAR(64), | ||
ALTER COLUMN merchant_id TYPE VARCHAR(64), | ||
ALTER COLUMN attempt_id TYPE VARCHAR(64), | ||
ALTER COLUMN connector_name TYPE VARCHAR(64), | ||
ALTER COLUMN connector_transaction_id TYPE VARCHAR(128); | ||
|
||
|
||
|
||
ALTER TABLE connector_response | ||
ALTER COLUMN modified_at DROP DEFAULT; | ||
|
||
ALTER TABLE connector_response | ||
ALTER COLUMN created_at DROP DEFAULT; | ||
|
||
ALTER TABLE connector_response ADD column updated_by VARCHAR(32) NOT NULL DEFAULT 'postgres_only'; |