Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

chore: include missing drop null constraint queries in v2_compatible_migrations (#8940)

Hrithikeshebfaba872ad7
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index a2fe05e777..1be5059f2a 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -19,6 +19,7 @@ crates/router/src/db/ @juspay/hyperswitch-framework
crates/router/src/routes/ @juspay/hyperswitch-framework
migrations/ @juspay/hyperswitch-framework
v2_migrations/ @juspay/hyperswitch-framework
+v2_compatible_migrations/ @juspay/hyperswitch-framework
api-reference/ @juspay/hyperswitch-framework
Cargo.toml @juspay/hyperswitch-framework
Cargo.lock @juspay/hyperswitch-framework
diff --git a/v2_compatible_migrations/2024-08-28-081757_drop_not_null_constraints_on_v1_columns/down.sql b/v2_compatible_migrations/2024-08-28-081757_drop_not_null_constraints_on_v1_columns/down.sql
index 819ba22b90..527adaf5e4 100644
--- a/v2_compatible_migrations/2024-08-28-081757_drop_not_null_constraints_on_v1_columns/down.sql
+++ b/v2_compatible_migrations/2024-08-28-081757_drop_not_null_constraints_on_v1_columns/down.sql
@@ -43,6 +43,9 @@ ALTER TABLE payment_attempt
ADD PRIMARY KEY (attempt_id, merchant_id),
ALTER COLUMN amount SET NOT NULL;
+ALTER TABLE payment_attempt
+ ALTER COLUMN confirm SET NOT NULL;
+
---------------------- Payment Methods ----------------------
DROP INDEX IF EXISTS idx_payment_methods_payment_method_id;
ALTER TABLE payment_methods
@@ -51,4 +54,6 @@ ALTER TABLE payment_methods
---------------------- Refunds ----------------------
DROP INDEX IF EXISTS idx_refund_refund_id_merchant_id;
ALTER TABLE refund
- ADD PRIMARY KEY (refund_id,merchant_id);
\ No newline at end of file
+ ADD PRIMARY KEY (refund_id,merchant_id);
+ALTER TABLE refund
+ ALTER COLUMN internal_reference_id SET NOT NULL;
\ No newline at end of file
diff --git a/v2_compatible_migrations/2024-08-28-081757_drop_not_null_constraints_on_v1_columns/up.sql b/v2_compatible_migrations/2024-08-28-081757_drop_not_null_constraints_on_v1_columns/up.sql
index 199609d324..965c6fd9dc 100644
--- a/v2_compatible_migrations/2024-08-28-081757_drop_not_null_constraints_on_v1_columns/up.sql
+++ b/v2_compatible_migrations/2024-08-28-081757_drop_not_null_constraints_on_v1_columns/up.sql
@@ -58,6 +58,9 @@ ALTER TABLE payment_attempt
-- This is done to nullify the effects of dropping primary key for v1
CREATE INDEX idx_payment_attempt_attempt_id_merchant_id ON payment_attempt (attempt_id, merchant_id);
+ALTER TABLE payment_attempt
+ ALTER COLUMN confirm DROP NOT NULL;
+
---------------------- Payment Methods ----------------------
ALTER TABLE payment_methods
DROP CONSTRAINT payment_methods_pkey,
@@ -69,5 +72,8 @@ CREATE INDEX idx_payment_methods_payment_method_id ON payment_methods (payment_m
ALTER TABLE refund
DROP CONSTRAINT refund_pkey,
ALTER COLUMN refund_id DROP NOT NULL;
+
+ALTER TABLE refund
+ ALTER COLUMN internal_reference_id DROP NOT NULL;
-- This is done to nullify the effects of dropping primary key for v1
CREATE INDEX idx_refund_refund_id_merchant_id ON refund (refund_id, merchant_id);
\ No newline at end of file