-
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.
refactor(merchant_account): change primary key for merchant account (#…
…5327) Co-authored-by: hrithikesh026 <[email protected]>
- Loading branch information
1 parent
6d74527
commit a0c367e
Showing
5 changed files
with
21 additions
and
3 deletions.
There are no files selected for viewing
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
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
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
5 changes: 5 additions & 0 deletions
5
migrations/2024-07-15-111327_change_primary_key_for_merchant_account/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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-- This file should undo anything in `up.sql` | ||
ALTER TABLE merchant_account DROP CONSTRAINT merchant_account_pkey; | ||
|
||
ALTER TABLE merchant_account | ||
ADD PRIMARY KEY (id); |
13 changes: 13 additions & 0 deletions
13
migrations/2024-07-15-111327_change_primary_key_for_merchant_account/up.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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
-- Your SQL goes here | ||
-- The below query will lock the merchant account table | ||
-- Running this query is not necessary on higher environments | ||
-- as the application will work fine without these queries being run | ||
-- This query is necessary for the application to not use id in update of merchant_account | ||
-- This query should be run after the new version of application is deployed | ||
ALTER TABLE merchant_account DROP CONSTRAINT merchant_account_pkey; | ||
|
||
-- Use the `merchant_id` column as primary key | ||
-- This is already a unique, not null column | ||
-- So this query should not fail for not null or duplicate values reasons | ||
ALTER TABLE merchant_account | ||
ADD PRIMARY KEY (merchant_id); |