repo stringclasses 4 values | file_path stringlengths 6 193 | extension stringclasses 23 values | content stringlengths 0 1.73M | token_count int64 0 724k | __index_level_0__ int64 0 10.8k |
|---|---|---|---|---|---|
hyperswitch | migrations/2023-09-25-125007_add_surcharge_metadata_payment_attempt/up.sql | .sql | -- Your SQL goes here
ALTER TABLE payment_attempt
ADD COLUMN IF NOT EXISTS surcharge_metadata JSONB DEFAULT NULL; | 24 | 600 |
hyperswitch | migrations/2023-09-25-125007_add_surcharge_metadata_payment_attempt/down.sql | .sql | -- This file should undo anything in `up.sql`
ALTER TABLE payment_attempt
DROP COLUMN surcharge_metadata; | 22 | 601 |
hyperswitch | migrations/2024-04-24-075735_add-merchant-pkey-ttl-to-business-profile/up.sql | .sql | -- Your SQL goes here
ALTER TABLE business_profile ADD COLUMN IF NOT EXISTS extended_card_info_config JSONB DEFAULT NULL; | 24 | 602 |
hyperswitch | migrations/2024-04-24-075735_add-merchant-pkey-ttl-to-business-profile/down.sql | .sql | -- This file should undo anything in `up.sql`
ALTER TABLE business_profile DROP COLUMN IF EXISTS extended_card_info_config; | 24 | 603 |
hyperswitch | migrations/2023-01-19-122511_add_refund_error_code/up.sql | .sql | ALTER TABLE refund
ADD IF NOT EXISTS refund_error_code TEXT DEFAULT NULL;
| 15 | 604 |
hyperswitch | migrations/2023-01-19-122511_add_refund_error_code/down.sql | .sql | ALTER TABLE refund
DROP COLUMN IF EXISTS refund_error_code;
| 12 | 605 |
hyperswitch | migrations/2024-07-15-120121_change_primary_key_for_dispute/up.sql | .sql | -- Your SQL goes here
-- The below query will lock the dispute 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 dispute
-- This query should be run only after the new version of application is deployed
ALTER TABLE dispute DROP CONSTRAINT dispute_pkey;
-- Use the `dispute_id` column as primary key
ALTER TABLE dispute
ADD PRIMARY KEY (dispute_id);
| 107 | 606 |
hyperswitch | migrations/2024-07-15-120121_change_primary_key_for_dispute/down.sql | .sql | ALTER TABLE dispute DROP CONSTRAINT dispute_pkey;
ALTER TABLE dispute ADD PRIMARY KEY (id); | 18 | 607 |
hyperswitch | migrations/2024-12-10-091820_add-clear-pan-possible-to-gsm/up.sql | .sql | -- Your SQL goes here
ALTER TABLE gateway_status_map ADD COLUMN IF NOT EXISTS clear_pan_possible BOOLEAN NOT NULL DEFAULT FALSE; | 25 | 608 |
hyperswitch | migrations/2024-12-10-091820_add-clear-pan-possible-to-gsm/down.sql | .sql | -- This file should undo anything in `up.sql`
ALTER TABLE gateway_status_map DROP COLUMN IF EXISTS clear_pan_possible; | 24 | 609 |
hyperswitch | migrations/2024-04-29-075651_store_payment_method_data_billing_in_payment_methods/up.sql | .sql | -- Your SQL goes here
ALTER TABLE payment_methods
ADD COLUMN IF NOT EXISTS payment_method_billing_address BYTEA;
| 23 | 610 |
hyperswitch | migrations/2024-04-29-075651_store_payment_method_data_billing_in_payment_methods/down.sql | .sql | -- This file should undo anything in `up.sql`
ALTER TABLE payment_methods DROP COLUMN IF EXISTS payment_method_billing_address;
| 24 | 611 |
hyperswitch | migrations/2024-03-15-133951_pm-client-secret/up.sql | .sql | -- Your SQL goes here
ALTER TABLE payment_methods ADD COLUMN IF NOT EXISTS client_secret VARCHAR(128) DEFAULT NULL;
ALTER TABLE payment_methods ALTER COLUMN payment_method DROP NOT NULL; | 38 | 612 |
hyperswitch | migrations/2024-03-15-133951_pm-client-secret/down.sql | .sql | -- This file should undo anything in `up.sql`
ALTER TABLE payment_methods DROP COLUMN IF EXISTS client_secret;
ALTER TABLE payment_methods ALTER COLUMN payment_method SET NOT NULL; | 34 | 613 |
hyperswitch | migrations/2023-10-19-075810_add_surcharge_applicable_payment_intent/up.sql | .sql | ALTER TABLE payment_attempt
DROP COLUMN surcharge_metadata;
ALTER TABLE payment_intent
ADD surcharge_applicable boolean; | 23 | 614 |
hyperswitch | migrations/2023-10-19-075810_add_surcharge_applicable_payment_intent/down.sql | .sql | ALTER TABLE payment_attempt
ADD COLUMN IF NOT EXISTS surcharge_metadata JSONB DEFAULT NULL;
ALTER TABLE payment_intent
DROP COLUMN surcharge_applicable;
| 30 | 615 |
hyperswitch | migrations/2022-12-13-170152_add_connector_metadata/up.sql | .sql | ALTER TABLE merchant_connector_account ADD COLUMN metadata JSONB DEFAULT NULL;
| 13 | 616 |
hyperswitch | migrations/2022-12-13-170152_add_connector_metadata/down.sql | .sql | ALTER TABLE merchant_connector_account DROP COLUMN metadata;
| 9 | 617 |
hyperswitch | migrations/2023-02-07-070512_change_merchant_connector_id_data_type/up.sql | .sql | ALTER TABLE merchant_connector_account
ALTER COLUMN merchant_connector_id TYPE VARCHAR(128) USING merchant_connector_id::varchar;
ALTER TABLE merchant_connector_account
ALTER COLUMN merchant_connector_id DROP DEFAULT;
| 39 | 618 |
hyperswitch | migrations/2023-02-07-070512_change_merchant_connector_id_data_type/down.sql | .sql | CREATE SEQUENCE IF NOT EXISTS merchant_connector_id_seq OWNED BY merchant_connector_account.merchant_connector_id;
UPDATE merchant_connector_account
SET merchant_connector_id = id;
ALTER TABLE merchant_connector_account
ALTER COLUMN merchant_connector_id TYPE INTEGER USING (trim(merchant_connector_id)::integer);
ALTER TABLE merchant_connector_account
ALTER COLUMN merchant_connector_id SET DEFAULT nextval('merchant_connector_id_seq');
| 77 | 619 |
hyperswitch | migrations/2022-12-07-055441_add_use_kv_to_merchant_account/up.sql | .sql | -- Your SQL goes here
CREATE TYPE "MerchantStorageScheme" AS ENUM (
'postgres_only',
'redis_kv'
);
ALTER TABLE merchant_account ADD COLUMN storage_scheme "MerchantStorageScheme" NOT NULL DEFAULT 'postgres_only';
| 47 | 620 |
hyperswitch | migrations/2022-12-07-055441_add_use_kv_to_merchant_account/down.sql | .sql | -- This file should undo anything in `up.sql`
ALTER TABLE merchant_account DROP COLUMN storage_scheme;
DROP TYPE "MerchantStorageScheme";
| 27 | 621 |
hyperswitch | migrations/2023-08-16-080721_make_connector_field_mandatory_capture_table/up.sql | .sql | -- Your SQL goes here
ALTER TABLE captures ALTER COLUMN connector SET NOT NULL;
ALTER TABLE captures RENAME COLUMN connector_transaction_id TO connector_capture_id;
ALTER TABLE captures add COLUMN IF NOT EXISTS connector_response_reference_id VARCHAR(128); | 48 | 622 |
hyperswitch | migrations/2023-08-16-080721_make_connector_field_mandatory_capture_table/down.sql | .sql | -- This file should undo anything in `up.sql`
ALTER TABLE captures ALTER COLUMN connector DROP NOT NULL;
ALTER TABLE captures RENAME COLUMN connector_capture_id TO connector_transaction_id;
ALTER TABLE captures DROP COLUMN IF EXISTS connector_response_reference_id; | 47 | 623 |
hyperswitch | migrations/2024-06-04-074145_add_client_secret_in_payouts/up.sql | .sql | -- Your SQL goes here
ALTER TABLE payouts ADD COLUMN IF NOT EXISTS client_secret VARCHAR(128) DEFAULT NULL;
ALTER TYPE "PayoutStatus" ADD VALUE IF NOT EXISTS 'requires_confirmation'; | 41 | 624 |
hyperswitch | migrations/2024-06-04-074145_add_client_secret_in_payouts/down.sql | .sql | ALTER TABLE payouts DROP COLUMN IF EXISTS client_secret; | 10 | 625 |
hyperswitch | migrations/2024-02-22-100718_role_name_org_id_constraint/up.sql | .sql | -- Your SQL goes here
CREATE UNIQUE INDEX role_name_org_id_org_scope_index ON roles(org_id, role_name) WHERE scope='organization';
CREATE UNIQUE INDEX role_name_merchant_id_merchant_scope_index ON roles(merchant_id, role_name) WHERE scope='merchant';
| 55 | 626 |
hyperswitch | migrations/2024-02-22-100718_role_name_org_id_constraint/down.sql | .sql | -- This file should undo anything in `up.sql`
DROP INDEX role_name_org_id_org_scope_index;
DROP INDEX role_name_merchant_id_merchant_scope_index;
| 33 | 627 |
hyperswitch | migrations/2023-02-22-100331_rename_pm_type_enum/up.sql | .sql | -- Your SQL goes here
ALTER TABLE payment_attempt
ALTER COLUMN payment_method TYPE VARCHAR;
ALTER TABLE payment_methods
ALTER COLUMN payment_method TYPE VARCHAR;
ALTER TABLE payment_methods
ALTER COLUMN payment_method_type TYPE VARCHAR;
ALTER TABLE payment_attempt DROP COLUMN payment_issuer;
ALTER TABLE payment_attempt
ADD COLUMN payment_method_data JSONB;
DROP TYPE "PaymentMethodType";
| 73 | 628 |
hyperswitch | migrations/2023-02-22-100331_rename_pm_type_enum/down.sql | .sql | -- This file should undo anything in `up.sql`
ALTER TABLE payment_attempt
ADD COLUMN payment_issuer VARCHAR;
CREATE TYPE "PaymentMethodType" AS ENUM (
'card',
'bank_transfer',
'netbanking',
'upi',
'open_banking',
'consumer_finance',
'wallet',
'pay_later'
);
ALTER TABLE payment_attempt
ALTER COLUMN payment_method TYPE "PaymentMethodType" USING payment_method::"PaymentMethodType";
ALTER TABLE payment_methods
ALTER COLUMN payment_method TYPE "PaymentMethodType" USING payment_method::"PaymentMethodType";
| 124 | 629 |
hyperswitch | migrations/2022-11-21-133803_add_mandate_id_in_payment_attempt/up.sql | .sql | -- Your SQL goes here
ALTER TABLE payment_attempt ADD IF NOT EXISTS mandate_id VARCHAR(255);
| 22 | 630 |
hyperswitch | migrations/2022-11-21-133803_add_mandate_id_in_payment_attempt/down.sql | .sql | -- This file should undo anything in `up.sql`
ALTER TABLE payment_attempt DROP COLUMN IF EXISTS mandate_id; | 22 | 631 |
hyperswitch | migrations/2023-12-15-062816__net_amount_in_payment_attempt/up.sql | .sql | ALTER TABLE payment_attempt
ADD COLUMN IF NOT EXISTS net_amount BIGINT;
-- Backfill
UPDATE payment_attempt pa
SET net_amount = pa.amount + COALESCE(pa.surcharge_amount, 0) + COALESCE(pa.tax_amount, 0);
| 54 | 632 |
hyperswitch | migrations/2023-12-15-062816__net_amount_in_payment_attempt/down.sql | .sql | -- This file should undo anything in `up.sql`
ALTER TABLE payment_attempt DROP COLUMN IF EXISTS net_amount; | 22 | 633 |
hyperswitch | migrations/2023-11-02-074243_make_customer_id_nullable_in_address_table/up.sql | .sql | -- Your SQL goes here
ALTER TABLE address ALTER COLUMN customer_id DROP NOT NULL; | 17 | 634 |
hyperswitch | migrations/2023-11-02-074243_make_customer_id_nullable_in_address_table/down.sql | .sql | -- This file should undo anything in `up.sql`
ALTER TABLE address ALTER COLUMN customer_id SET NOT NULL; | 22 | 635 |
hyperswitch | migrations/2025-02-10-101701_recreate_varchar_id_column_for_merchant_account/up.sql | .sql | -- Your SQL goes here
ALTER TABLE merchant_account
ADD COLUMN IF NOT EXISTS id VARCHAR(64); | 22 | 636 |
hyperswitch | migrations/2025-02-10-101701_recreate_varchar_id_column_for_merchant_account/down.sql | .sql | -- This file should undo anything in `up.sql`
ALTER TABLE merchant_account DROP id; | 18 | 637 |
hyperswitch | migrations/2024-12-18-124527_add_new_value_in_success_based_routing_conclusive_state/up.sql | .sql | -- Your SQL goes here
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1
FROM pg_enum
WHERE enumlabel = 'non_deterministic'
AND enumtypid = (SELECT oid FROM pg_type WHERE typname = 'SuccessBasedRoutingConclusiveState')
) THEN
ALTER TYPE "SuccessBasedRoutingConclusiveState" ADD VALUE 'non_deterministic';
END IF;
END $$;
| 91 | 638 |
hyperswitch | migrations/2024-12-18-124527_add_new_value_in_success_based_routing_conclusive_state/down.sql | .sql | -- This file should undo anything in `up.sql`
SELECT 1;
| 15 | 639 |
hyperswitch | migrations/2023-04-19-120735_add_time_for_tables/up.sql | .sql | -- Your SQL goes here
ALTER TABLE merchant_account
ADD COLUMN IF NOT EXISTS created_at TIMESTAMP NOT NULL DEFAULT now(),
ADD COLUMN IF NOT EXISTS modified_at TIMESTAMP NOT NULL DEFAULT now();
ALTER TABLE merchant_connector_account
ADD COLUMN IF NOT EXISTS created_at TIMESTAMP NOT NULL DEFAULT now(),
ADD COLUMN IF NOT EXISTS modified_at TIMESTAMP NOT NULL DEFAULT now();
ALTER TABLE customers
ADD COLUMN IF NOT EXISTS modified_at TIMESTAMP NOT NULL DEFAULT now();
| 86 | 640 |
hyperswitch | migrations/2023-04-19-120735_add_time_for_tables/down.sql | .sql | -- This file should undo anything in `up.sql`
ALTER TABLE merchant_account
DROP COLUMN IF EXISTS created_at,
DROP COLUMN IF EXISTS modified_at;
ALTER TABLE merchant_connector_account
DROP COLUMN IF EXISTS created_at,
DROP COLUMN IF EXISTS modified_at;
ALTER TABLE customers
DROP COLUMN IF EXISTS modified_at;
| 61 | 641 |
hyperswitch | migrations/2024-02-11-092812_add_authentication_processor_enum_to_ConnectorType/up.sql | .sql | -- Your SQL goes here
ALTER TYPE "ConnectorType" ADD VALUE IF NOT EXISTS 'authentication_processor';
| 21 | 642 |
hyperswitch | migrations/2024-02-11-092812_add_authentication_processor_enum_to_ConnectorType/down.sql | .sql | -- This file should undo anything in `up.sql`
SELECT 1; | 15 | 643 |
hyperswitch | migrations/2024-07-23-100214_make_org_and_merchant_id_nullable_user_roles/up.sql | .sql | -- Your SQL goes here
-- The below query will lock the user_roles 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 user_roles DROP CONSTRAINT user_roles_pkey;
-- Use the `id` column as primary key
-- This is serial and a not null column
-- So this query should not fail for not null or duplicate value reasons
ALTER TABLE user_roles ADD PRIMARY KEY (id);
ALTER TABLE user_roles ALTER COLUMN org_id DROP NOT NULL;
ALTER TABLE user_roles ALTER COLUMN merchant_id DROP NOT NULL;
ALTER TABLE user_roles ADD COLUMN profile_id VARCHAR(64);
ALTER TABLE user_roles ADD COLUMN entity_id VARCHAR(64);
ALTER TABLE user_roles ADD COLUMN entity_type VARCHAR(64);
CREATE TYPE "UserRoleVersion" AS ENUM('v1', 'v2');
ALTER TABLE user_roles ADD COLUMN version "UserRoleVersion" DEFAULT 'v1' NOT NULL;
| 211 | 644 |
hyperswitch | migrations/2024-07-23-100214_make_org_and_merchant_id_nullable_user_roles/down.sql | .sql | -- This file should undo anything in `up.sql`
ALTER TABLE user_roles DROP CONSTRAINT user_roles_pkey;
ALTER TABLE user_roles ADD PRIMARY KEY (user_id, merchant_id);
ALTER TABLE user_roles ALTER COLUMN org_id SET NOT NULL;
ALTER TABLE user_roles ALTER COLUMN merchant_id SET NOT NULL;
ALTER TABLE user_roles DROP COLUMN profile_id;
ALTER TABLE user_roles DROP COLUMN entity_id;
ALTER TABLE user_roles DROP COLUMN entity_type;
ALTER TABLE user_roles DROP COLUMN version;
DROP TYPE IF EXISTS "UserRoleVersion";
| 103 | 645 |
hyperswitch | migrations/2024-04-23-132120_add-extended-card-info-to-business-profile/up.sql | .sql | -- Your SQL goes here
ALTER TABLE business_profile ADD COLUMN IF NOT EXISTS is_extended_card_info_enabled BOOLEAN DEFAULT FALSE; | 24 | 646 |
hyperswitch | migrations/2024-04-23-132120_add-extended-card-info-to-business-profile/down.sql | .sql | -- This file should undo anything in `up.sql`
ALTER TABLE business_profile DROP COLUMN IF EXISTS is_extended_card_info_enabled; | 25 | 647 |
hyperswitch | migrations/2024-05-27-190323_add_new_status_to_payout_status/up.sql | .sql | -- Your SQL goes here
ALTER TYPE "PayoutStatus" ADD VALUE IF NOT EXISTS 'initiated';
ALTER TYPE "PayoutStatus" ADD VALUE IF NOT EXISTS 'expired';
ALTER TYPE "PayoutStatus" ADD VALUE IF NOT EXISTS 'reversed'; | 53 | 648 |
hyperswitch | migrations/2024-05-27-190323_add_new_status_to_payout_status/down.sql | .sql | SELECT 1; | 4 | 649 |
hyperswitch | migrations/2024-12-04-072648_add_is_click_to_pay_enabled/up.sql | .sql | -- Your SQL goes here
ALTER TABLE business_profile ADD COLUMN IF NOT EXISTS is_click_to_pay_enabled BOOLEAN NOT NULL DEFAULT FALSE; | 26 | 650 |
hyperswitch | migrations/2024-12-04-072648_add_is_click_to_pay_enabled/down.sql | .sql | -- This file should undo anything in `up.sql`
ALTER TABLE business_profile DROP COLUMN IF EXISTS is_click_to_pay_enabled; | 25 | 651 |
hyperswitch | migrations/2024-12-11-092649_add-authentication-product-ids-in-business-profile/up.sql | .sql | -- Your SQL goes here
ALTER TABLE business_profile
ADD COLUMN IF NOT EXISTS authentication_product_ids JSONB NULL;
| 23 | 652 |
hyperswitch | migrations/2024-12-11-092649_add-authentication-product-ids-in-business-profile/down.sql | .sql | -- This file should undo anything in `up.sql`
ALTER TABLE business_profile
DROP COLUMN IF EXISTS authentication_product_ids
| 24 | 653 |
hyperswitch | migrations/2022-11-08-101705_add_cancel_to_payment_intent_status/up.sql | .sql | -- Your SQL goes here
ALTER TYPE "IntentStatus" ADD VALUE 'cancelled' after 'failed';
| 21 | 654 |
hyperswitch | migrations/2022-11-08-101705_add_cancel_to_payment_intent_status/down.sql | .sql | DELETE FROM pg_enum
WHERE enumlabel = 'cancelled'
AND enumtypid = (
SELECT oid FROM pg_type WHERE typname = 'IntentStatus'
)
| 33 | 655 |
hyperswitch | migrations/2024-01-22-114747_add_authentication_fields_to_attempt/up.sql | .sql | -- Your SQL goes here
ALTER TABLE payment_attempt
ADD COLUMN IF NOT EXISTS external_three_ds_authentication_attempted BOOLEAN default false,
ADD COLUMN IF NOT EXISTS authentication_connector VARCHAR(64),
ADD COLUMN IF NOT EXISTS authentication_id VARCHAR(64); | 50 | 656 |
hyperswitch | migrations/2024-01-22-114747_add_authentication_fields_to_attempt/down.sql | .sql | -- This file should undo anything in `up.sql`
ALTER TABLE payment_attempt
DROP COLUMN IF EXISTS external_three_ds_authentication_attempted,
DROP COLUMN IF EXISTS authentication_connector,
DROP COLUMN IF EXISTS authentication_id; | 41 | 657 |
hyperswitch | migrations/2024-07-19-095541_change_primary_key_for_users/up.sql | .sql | -- Your SQL goes here
-- The below query will lock the users 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 users DROP CONSTRAINT users_pkey;
-- Use the `user_id` columns as primary key
-- These are already unique, not null column
-- So this query should not fail for not null or duplicate value reasons
ALTER TABLE users
ADD PRIMARY KEY (user_id);
| 112 | 658 |
hyperswitch | migrations/2024-07-19-095541_change_primary_key_for_users/down.sql | .sql | -- This file should undo anything in `up.sql`
ALTER TABLE users DROP CONSTRAINT users_pkey;
ALTER TABLE users
ADD PRIMARY KEY (id);
| 30 | 659 |
hyperswitch | migrations/2024-07-15-111327_change_primary_key_for_merchant_account/up.sql | .sql | -- 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);
| 135 | 660 |
hyperswitch | migrations/2024-07-15-111327_change_primary_key_for_merchant_account/down.sql | .sql | -- 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);
| 33 | 661 |
hyperswitch | migrations/2023-05-05-112013_add_evidence_col_in_dispute/up.sql | .sql | -- Your SQL goes here
ALTER TABLE dispute
ADD COLUMN evidence JSONB NOT NULL DEFAULT '{}'::JSONB; | 23 | 662 |
hyperswitch | migrations/2023-05-05-112013_add_evidence_col_in_dispute/down.sql | .sql | ALTER TABLE dispute DROP COLUMN evidence; | 7 | 663 |
hyperswitch | migrations/2024-03-01-111007_add_authentication_details_in_business_profile/up.sql | .sql | -- Your SQL goes here
ALTER TABLE business_profile
ADD COLUMN IF NOT EXISTS authentication_connector_details JSONB NULL;
| 23 | 664 |
hyperswitch | migrations/2024-03-01-111007_add_authentication_details_in_business_profile/down.sql | .sql | -- This file should undo anything in `up.sql`
ALTER TABLE business_profile
DROP COLUMN IF EXISTS authentication_connector_details; | 24 | 665 |
hyperswitch | migrations/2024-01-30-090815_alter_payout_type/up.sql | .sql | -- Your SQL goes here
ALTER TYPE "PayoutType" ADD VALUE IF NOT EXISTS 'wallet'; | 21 | 666 |
hyperswitch | migrations/2024-01-30-090815_alter_payout_type/down.sql | .sql | -- This file should undo anything in `up.sql`
SELECT 1; | 15 | 667 |
hyperswitch | migrations/2024-12-05-131123_add-email-theme-data-in-themes/up.sql | .sql | -- Your SQL goes here
ALTER TABLE themes ADD COLUMN IF NOT EXISTS email_primary_color VARCHAR(64) NOT NULL DEFAULT '#006DF9';
ALTER TABLE themes ADD COLUMN IF NOT EXISTS email_foreground_color VARCHAR(64) NOT NULL DEFAULT '#000000';
ALTER TABLE themes ADD COLUMN IF NOT EXISTS email_background_color VARCHAR(64) NOT NULL DEFAULT '#FFFFFF';
ALTER TABLE themes ADD COLUMN IF NOT EXISTS email_entity_name VARCHAR(64) NOT NULL DEFAULT 'Hyperswitch';
ALTER TABLE themes ADD COLUMN IF NOT EXISTS email_entity_logo_url TEXT NOT NULL DEFAULT 'https://app.hyperswitch.io/email-assets/HyperswitchLogo.png';
| 141 | 668 |
hyperswitch | migrations/2024-12-05-131123_add-email-theme-data-in-themes/down.sql | .sql | -- This file should undo anything in `up.sql`
ALTER TABLE themes DROP COLUMN IF EXISTS email_primary_color;
ALTER TABLE themes DROP COLUMN IF EXISTS email_foreground_color;
ALTER TABLE themes DROP COLUMN IF EXISTS email_background_color;
ALTER TABLE themes DROP COLUMN IF EXISTS email_entity_name;
ALTER TABLE themes DROP COLUMN IF EXISTS email_entity_logo_url;
| 68 | 669 |
hyperswitch | migrations/2024-09-01-094614_remove-preferred-merchant-from-users/up.sql | .sql | -- Your SQL goes here
ALTER TABLE users DROP COLUMN preferred_merchant_id;
| 16 | 670 |
hyperswitch | migrations/2024-09-01-094614_remove-preferred-merchant-from-users/down.sql | .sql | -- This file should undo anything in `up.sql`
ALTER TABLE users ADD COLUMN preferred_merchant_id VARCHAR(64);
| 25 | 671 |
hyperswitch | migrations/2024-02-20-180952_add_connector_metadata_in_authentication/up.sql | .sql | -- Your SQL goes here
ALTER TABLE authentication ADD COLUMN IF NOT EXISTS connector_metadata JSONB DEFAULT NULL;
| 21 | 672 |
hyperswitch | migrations/2024-02-20-180952_add_connector_metadata_in_authentication/down.sql | .sql | -- This file should undo anything in `up.sql`
ALTER TABLE authentication DROP COLUMN IF EXISTS connector_metadata;
| 21 | 673 |
hyperswitch | migrations/2022-12-09-102635_mandate-connector-and-amount/up.sql | .sql | -- Your SQL goes here
ALTER TABLE mandate
RENAME COLUMN single_use_amount TO mandate_amount;
ALTER TABLE mandate
RENAME COLUMN single_use_currency TO mandate_currency;
ALTER TABLE mandate
ADD IF NOT EXISTS amount_captured INTEGER DEFAULT NULL,
ADD IF NOT EXISTS connector VARCHAR(255) NOT NULL DEFAULT 'dummy',
ADD IF NOT EXISTS connector_mandate_id VARCHAR(255) DEFAULT NULL; | 84 | 674 |
hyperswitch | migrations/2022-12-09-102635_mandate-connector-and-amount/down.sql | .sql | -- This file should undo anything in `up.sql`
ALTER TABLE mandate
RENAME COLUMN mandate_amount TO single_use_amount;
ALTER TABLE mandate
RENAME COLUMN mandate_currency TO single_use_currency;
ALTER TABLE mandate
DROP COLUMN IF EXISTS amount_captured,
DROP COLUMN IF EXISTS connector,
DROP COLUMN IF EXISTS connector_mandate_id; | 67 | 675 |
hyperswitch | migrations/2023-03-23-095309_add_business_sub_label_to_mca/up.sql | .sql | ALTER TABLE merchant_connector_account
ADD COLUMN IF NOT EXISTS business_sub_label VARCHAR(64) DEFAULT 'default';
| 23 | 676 |
hyperswitch | migrations/2023-03-23-095309_add_business_sub_label_to_mca/down.sql | .sql | ALTER TABLE merchant_connector_account DROP COLUMN IF EXISTS business_sub_label;
| 13 | 677 |
hyperswitch | migrations/2024-06-14-145304_events_add_metadata_column/up.sql | .sql | ALTER TABLE events ADD COLUMN metadata JSONB DEFAULT NULL;
| 11 | 678 |
hyperswitch | migrations/2024-06-14-145304_events_add_metadata_column/down.sql | .sql | ALTER TABLE events DROP COLUMN metadata;
| 7 | 679 |
hyperswitch | migrations/2023-02-02-055700_add_payment_issuer_and_experience_in_payment_attempt/up.sql | .sql | -- Your SQL goes here
ALTER TABLE payment_attempt
ADD COLUMN IF NOT EXISTS payment_issuer VARCHAR(50);
ALTER TABLE payment_attempt
ADD COLUMN IF NOT EXISTS payment_experience VARCHAR(50);
| 41 | 680 |
hyperswitch | migrations/2023-02-02-055700_add_payment_issuer_and_experience_in_payment_attempt/down.sql | .sql | ALTER TABLE payment_attempt DROP COLUMN IF EXISTS payment_issuer;
ALTER TABLE payment_attempt DROP COLUMN IF EXISTS payment_experience;
| 23 | 681 |
hyperswitch | migrations/2023-03-15-185959_add_dispute_table/up.sql | .sql | CREATE TYPE "DisputeStage" AS ENUM ('pre_dispute', 'dispute', 'pre_arbitration');
CREATE TYPE "DisputeStatus" AS ENUM ('dispute_opened', 'dispute_expired', 'dispute_accepted', 'dispute_cancelled', 'dispute_challenged', 'dispute_won', 'dispute_lost');
CREATE TABLE dispute (
id SERIAL PRIMARY KEY,
dispute_id VARCHAR(64) NOT NULL,
amount VARCHAR(255) NOT NULL,
currency VARCHAR(255) NOT NULL,
dispute_stage "DisputeStage" NOT NULL,
dispute_status "DisputeStatus" NOT NULL,
payment_id VARCHAR(255) NOT NULL,
attempt_id VARCHAR(64) NOT NULL,
merchant_id VARCHAR(255) NOT NULL,
connector_status VARCHAR(255) NOT NULL,
connector_dispute_id VARCHAR(255) NOT NULL,
connector_reason VARCHAR(255),
connector_reason_code VARCHAR(255),
challenge_required_by VARCHAR(255),
dispute_created_at VARCHAR(255),
updated_at VARCHAR(255),
created_at TIMESTAMP NOT NULL DEFAULT now()::TIMESTAMP,
modified_at TIMESTAMP NOT NULL DEFAULT now()::TIMESTAMP
);
CREATE UNIQUE INDEX merchant_id_dispute_id_index ON dispute (merchant_id, dispute_id);
CREATE UNIQUE INDEX merchant_id_payment_id_connector_dispute_id_index ON dispute (merchant_id, payment_id, connector_dispute_id);
CREATE INDEX dispute_status_index ON dispute (dispute_status);
CREATE INDEX dispute_stage_index ON dispute (dispute_stage);
ALTER TYPE "EventClass" ADD VALUE 'disputes';
ALTER TYPE "EventObjectType" ADD VALUE 'dispute_details';
ALTER TYPE "EventType" ADD VALUE 'dispute_opened';
ALTER TYPE "EventType" ADD VALUE 'dispute_expired';
ALTER TYPE "EventType" ADD VALUE 'dispute_accepted';
ALTER TYPE "EventType" ADD VALUE 'dispute_cancelled';
ALTER TYPE "EventType" ADD VALUE 'dispute_challenged';
ALTER TYPE "EventType" ADD VALUE 'dispute_won';
ALTER TYPE "EventType" ADD VALUE 'dispute_lost';
| 457 | 682 |
hyperswitch | migrations/2023-03-15-185959_add_dispute_table/down.sql | .sql | DROP TABLE dispute;
DROP TYPE "DisputeStage";
DROP TYPE "DisputeStatus";
| 18 | 683 |
hyperswitch | migrations/2023-05-16-145008_mandate_data_in_pa/up.sql | .sql | -- Your SQL goes here
ALTER TABLE payment_attempt ADD COLUMN mandate_details JSONB;
| 17 | 684 |
hyperswitch | migrations/2023-05-16-145008_mandate_data_in_pa/down.sql | .sql | -- This file should undo anything in `up.sql`
ALTER TABLE payment_attempt DROP COLUMN mandate_details;
| 20 | 685 |
hyperswitch | migrations/2024-12-17-141811_add_relay_table/up.sql | .sql | -- Your SQL goes here
CREATE TYPE "RelayStatus" AS ENUM ('created', 'pending', 'failure', 'success');
CREATE TYPE "RelayType" AS ENUM ('refund');
CREATE TABLE relay (
id VARCHAR(64) PRIMARY KEY,
connector_resource_id VARCHAR(128) NOT NULL,
connector_id VARCHAR(64) NOT NULL,
profile_id VARCHAR(64) NOT NULL,
merchant_id VARCHAR(64) NOT NULL,
relay_type "RelayType" NOT NULL,
request_data JSONB DEFAULT NULL,
status "RelayStatus" NOT NULL,
connector_reference_id VARCHAR(128),
error_code VARCHAR(64),
error_message TEXT,
created_at TIMESTAMP NOT NULL DEFAULT now()::TIMESTAMP,
modified_at TIMESTAMP NOT NULL DEFAULT now()::TIMESTAMP,
response_data JSONB DEFAULT NULL
);
| 186 | 686 |
hyperswitch | migrations/2024-12-17-141811_add_relay_table/down.sql | .sql | -- This file should undo anything in `up.sql`
DROP TABLE relay;
DROP TYPE IF EXISTS "RelayStatus";
DROP TYPE IF EXISTS "RelayType";
| 33 | 687 |
hyperswitch | migrations/2024-07-17-131830_alter_payment_link/up.sql | .sql | -- Add a new column for allowed domains and secure link endpoint
ALTER table payment_link ADD COLUMN IF NOT EXISTS secure_link VARCHAR(255); | 30 | 688 |
hyperswitch | migrations/2024-07-17-131830_alter_payment_link/down.sql | .sql | ALTER table payment_link DROP COLUMN IF EXISTS secure_link; | 11 | 689 |
hyperswitch | migrations/2023-09-17-152010_make_id_not_null_address/up.sql | .sql | -- Your SQL goes here
ALTER TABLE address ALTER COLUMN id DROP NOT NULL; | 16 | 690 |
hyperswitch | migrations/2023-09-17-152010_make_id_not_null_address/down.sql | .sql | -- This file should undo anything in `up.sql`
ALTER TABLE address ALTER COLUMN id SET NOT NULL; | 21 | 691 |
hyperswitch | migrations/2024-12-16-111228_add_new_col_payment_method_type_in_dynamic_routing_stats/up.sql | .sql | -- Your SQL goes here
ALTER TABLE dynamic_routing_stats
ADD COLUMN IF NOT EXISTS payment_method_type VARCHAR(64);
| 25 | 692 |
hyperswitch | migrations/2024-12-16-111228_add_new_col_payment_method_type_in_dynamic_routing_stats/down.sql | .sql | -- This file should undo anything in `up.sql`
ALTER TABLE dynamic_routing_stats
DROP COLUMN IF EXISTS payment_method_type;
| 25 | 693 |
hyperswitch | migrations/2024-07-29-062548_add-organization_name-and-id-fields-in-organization/up.sql | .sql | -- Your SQL goes here
ALTER TABLE organization
ADD COLUMN id VARCHAR(32);
ALTER TABLE organization
ADD COLUMN organization_name TEXT;
| 29 | 694 |
hyperswitch | migrations/2024-07-29-062548_add-organization_name-and-id-fields-in-organization/down.sql | .sql | -- This file should undo anything in `up.sql`
ALTER TABLE organization
DROP COLUMN id;
ALTER TABLE organization
DROP COLUMN organization_name; | 28 | 695 |
hyperswitch | migrations/2023-12-12-112941_create_pm_blocklist_table/up.sql | .sql | -- Your SQL goes here
CREATE TABLE blocklist (
id SERIAL PRIMARY KEY,
merchant_id VARCHAR(64) NOT NULL,
fingerprint_id VARCHAR(64) NOT NULL,
data_kind "BlocklistDataKind" NOT NULL,
metadata JSONB,
created_at TIMESTAMP NOT NULL
);
CREATE UNIQUE INDEX blocklist_unique_fingerprint_id_index ON blocklist (merchant_id, fingerprint_id);
CREATE INDEX blocklist_merchant_id_data_kind_created_at_index ON blocklist (merchant_id, data_kind, created_at DESC);
| 110 | 696 |
hyperswitch | migrations/2023-12-12-112941_create_pm_blocklist_table/down.sql | .sql | -- This file should undo anything in `up.sql`
DROP TABLE blocklist;
| 16 | 697 |
hyperswitch | migrations/2024-06-20-142013_collect_billing_details_from_wallet_connector/up.sql | .sql | -- Your SQL goes here
ALTER TABLE business_profile ADD COLUMN IF NOT EXISTS collect_billing_details_from_wallet_connector BOOLEAN DEFAULT FALSE; | 25 | 698 |
hyperswitch | migrations/2024-06-20-142013_collect_billing_details_from_wallet_connector/down.sql | .sql | -- This file should undo anything in `up.sql`
ALTER TABLE business_profile DROP COLUMN IF EXISTS collect_billing_details_from_wallet_connector; | 26 | 699 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.