mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 03:13:56 +08:00
refactor(core): change primary key of refund table (#5367)
This commit is contained in:
@ -1099,7 +1099,7 @@ diesel::table! {
|
||||
use diesel::sql_types::*;
|
||||
use crate::enums::diesel_exports::*;
|
||||
|
||||
refund (id) {
|
||||
refund (merchant_id, refund_id) {
|
||||
id -> Int4,
|
||||
#[max_length = 64]
|
||||
internal_reference_id -> Varchar,
|
||||
|
||||
@ -1097,7 +1097,7 @@ diesel::table! {
|
||||
use diesel::sql_types::*;
|
||||
use crate::enums::diesel_exports::*;
|
||||
|
||||
refund (id) {
|
||||
refund (merchant_id, refund_id) {
|
||||
id -> Int4,
|
||||
#[max_length = 64]
|
||||
internal_reference_id -> Varchar,
|
||||
|
||||
@ -0,0 +1,5 @@
|
||||
-- This file should undo anything in `up.sql`
|
||||
ALTER TABLE refund DROP CONSTRAINT refund_pkey;
|
||||
|
||||
ALTER TABLE refund
|
||||
ADD PRIMARY KEY (id);
|
||||
@ -0,0 +1,12 @@
|
||||
-- Your SQL goes here
|
||||
-- The below query will lock the refund table
|
||||
-- Running this query is not necessary on higher environments
|
||||
-- as the application will work fine without these queries being run
|
||||
-- This query should be run after the new version of application is deployed
|
||||
ALTER TABLE refund DROP CONSTRAINT refund_pkey;
|
||||
|
||||
-- Use the `merchant_id, refund_id` columns as primary key
|
||||
-- These are already unique, not null columns
|
||||
-- So this query should not fail for not null or duplicate value reasons
|
||||
ALTER TABLE refund
|
||||
ADD PRIMARY KEY (merchant_id, refund_id);
|
||||
Reference in New Issue
Block a user