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/2024-04-17-084906_add_generic_link_table/up.sql
|
.sql
|
CREATE TYPE "GenericLinkType" as ENUM(
'payment_method_collect',
'payout_link'
);
CREATE TABLE generic_link (
link_id VARCHAR (64) NOT NULL PRIMARY KEY,
primary_reference VARCHAR (64) NOT NULL,
merchant_id VARCHAR (64) NOT NULL,
created_at timestamp NOT NULL DEFAULT NOW():: timestamp,
last_modified_at timestamp NOT NULL DEFAULT NOW():: timestamp,
expiry timestamp NOT NULL,
link_data JSONB NOT NULL,
link_status JSONB NOT NULL,
link_type "GenericLinkType" NOT NULL,
url TEXT NOT NULL,
return_url TEXT NULL
);
| 134 | 100 |
hyperswitch
|
migrations/2024-04-17-084906_add_generic_link_table/down.sql
|
.sql
|
DROP TABLE IF EXISTS generic_link;
DROP TYPE IF EXISTS "GenericLinkType"
| 17 | 101 |
hyperswitch
|
migrations/2023-07-03-093552_add_attempt_count_in_payment_intent/up.sql
|
.sql
|
ALTER TABLE payment_intent ADD COLUMN attempt_count SMALLINT NOT NULL DEFAULT 1;
UPDATE payment_intent
SET attempt_count = payment_id_count.count
FROM (SELECT payment_id, count(payment_id) FROM payment_attempt GROUP BY payment_id) as payment_id_count
WHERE payment_intent.payment_id = payment_id_count.payment_id;
| 64 | 102 |
hyperswitch
|
migrations/2023-07-03-093552_add_attempt_count_in_payment_intent/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
ALTER TABLE PAYMENT_INTENT DROP COLUMN attempt_count;
| 22 | 103 |
hyperswitch
|
migrations/2023-04-27-120010_add_payment_failed_event_type/up.sql
|
.sql
|
ALTER TYPE "EventType" ADD VALUE IF NOT EXISTS 'payment_failed';
| 14 | 104 |
hyperswitch
|
migrations/2023-04-27-120010_add_payment_failed_event_type/down.sql
|
.sql
|
DELETE FROM pg_enum
WHERE enumlabel = 'payment_failed'
AND enumtypid = (
SELECT oid FROM pg_type WHERE typname = 'EventType'
);
| 33 | 105 |
hyperswitch
|
migrations/2023-04-25-141011_add_connector_label_col_in_file_metadata/up.sql
|
.sql
|
-- Your SQL goes here
ALTER TABLE file_metadata
ADD COLUMN connector_label VARCHAR(255);
| 21 | 106 |
hyperswitch
|
migrations/2023-04-25-141011_add_connector_label_col_in_file_metadata/down.sql
|
.sql
|
ALTER TABLE file_metadata DROP COLUMN connector_label;
| 9 | 107 |
hyperswitch
|
migrations/2024-08-09-102122_added_tax_connector_id_and_is_tax_connector_enabled_in_business_profile_table/up.sql
|
.sql
|
-- Your SQL goes here
ALTER TABLE business_profile ADD COLUMN IF NOT EXISTS tax_connector_id VARCHAR(64);
ALTER TABLE business_profile ADD COLUMN IF NOT EXISTS is_tax_connector_enabled BOOLEAN;
| 38 | 108 |
hyperswitch
|
migrations/2024-08-09-102122_added_tax_connector_id_and_is_tax_connector_enabled_in_business_profile_table/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
ALTER TABLE business_profile DROP COLUMN IF EXISTS tax_connector_id;
ALTER TABLE business_profile DROP COLUMN IF EXISTS is_tax_connector_enabled;
| 36 | 109 |
hyperswitch
|
migrations/2023-11-17-061003_add-unified-error-code-mssg-gsm/up.sql
|
.sql
|
-- Your SQL goes here
ALTER TABLE gateway_status_map ADD COLUMN IF NOT EXISTS unified_code VARCHAR(255);
ALTER TABLE gateway_status_map ADD COLUMN IF NOT EXISTS unified_message VARCHAR(1024);
| 43 | 110 |
hyperswitch
|
migrations/2023-11-17-061003_add-unified-error-code-mssg-gsm/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
ALTER TABLE gateway_status_map DROP COLUMN IF EXISTS unified_code;
ALTER TABLE gateway_status_map DROP COLUMN IF EXISTS unified_message;
| 35 | 111 |
hyperswitch
|
migrations/2024-02-15-133957_add_email_to_address/up.sql
|
.sql
|
-- Your SQL goes here
ALTER TABLE address
ADD COLUMN IF NOT EXISTS email BYTEA;
| 19 | 112 |
hyperswitch
|
migrations/2024-02-15-133957_add_email_to_address/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
ALTER TABLE address DROP COLUMN IF EXISTS email;
| 20 | 113 |
hyperswitch
|
migrations/2023-11-12-131143_connector-status-column/up.sql
|
.sql
|
-- Your SQL goes here
CREATE TYPE "ConnectorStatus" AS ENUM ('active', 'inactive');
ALTER TABLE merchant_connector_account
ADD COLUMN status "ConnectorStatus";
UPDATE merchant_connector_account SET status='active';
ALTER TABLE merchant_connector_account
ALTER COLUMN status SET NOT NULL,
ALTER COLUMN status SET DEFAULT 'inactive';
| 63 | 114 |
hyperswitch
|
migrations/2023-11-12-131143_connector-status-column/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
ALTER TABLE merchant_connector_account DROP COLUMN IF EXISTS status;
DROP TYPE IF EXISTS "ConnectorStatus";
| 30 | 115 |
hyperswitch
|
migrations/2023-11-06-065213_add_description_to_payment_link/up.sql
|
.sql
|
-- Your SQL goes here
ALTER table payment_link ADD COLUMN IF NOT EXISTS description VARCHAR (255);
| 22 | 116 |
hyperswitch
|
migrations/2023-11-06-065213_add_description_to_payment_link/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
ALTER TABLE payment_link DROP COLUMN IF EXISTS description;
| 21 | 117 |
hyperswitch
|
migrations/2023-09-08-101302_add_payment_link/up.sql
|
.sql
|
-- Your SQL goes here
CREATE TABLE payment_link (
payment_link_id VARCHAR(255) NOT NULL,
payment_id VARCHAR(64) NOT NULL,
link_to_pay VARCHAR(255) NOT NULL,
merchant_id VARCHAR(64) NOT NULL,
amount INT8 NOT NULL,
currency "Currency",
created_at TIMESTAMP NOT NULL,
last_modified_at TIMESTAMP NOT NULL,
fulfilment_time TIMESTAMP,
PRIMARY KEY (payment_link_id)
);
| 101 | 118 |
hyperswitch
|
migrations/2023-09-08-101302_add_payment_link/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
drop table payment_link;
| 16 | 119 |
hyperswitch
|
migrations/2023-04-19-072152_merchant_account_add_intent_fulfilment_time/up.sql
|
.sql
|
ALTER TABLE merchant_account ADD COLUMN IF NOT EXISTS intent_fulfillment_time BIGINT;
| 17 | 120 |
hyperswitch
|
migrations/2023-04-19-072152_merchant_account_add_intent_fulfilment_time/down.sql
|
.sql
|
ALTER TABLE merchant_account DROP COLUMN IF EXISTS intent_fulfillment_time;
| 14 | 121 |
hyperswitch
|
migrations/2024-12-18-061400_change-roles-index/up.sql
|
.sql
|
-- Your SQL goes here
DROP INDEX IF EXISTS role_name_org_id_org_scope_index;
DROP INDEX IF EXISTS role_name_merchant_id_merchant_scope_index;
DROP INDEX IF EXISTS roles_merchant_org_index;
CREATE INDEX roles_merchant_org_index ON roles (
org_id,
merchant_id,
profile_id
);
| 65 | 122 |
hyperswitch
|
migrations/2024-12-18-061400_change-roles-index/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
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';
DROP INDEX IF EXISTS roles_merchant_org_index;
| 77 | 123 |
hyperswitch
|
migrations/2023-12-28-063619_add_enum_types_to_EventType/up.sql
|
.sql
|
-- Your SQL goes here
ALTER TYPE "EventType" ADD VALUE IF NOT EXISTS 'payment_authorized';
ALTER TYPE "EventType" ADD VALUE IF NOT EXISTS 'payment_captured';
| 36 | 124 |
hyperswitch
|
migrations/2023-12-28-063619_add_enum_types_to_EventType/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
SELECT 1;
| 15 | 125 |
hyperswitch
|
migrations/2023-10-05-130917_add_mandate_webhook_types/up.sql
|
.sql
|
-- Your SQL goes here
ALTER TYPE "EventClass" ADD VALUE 'mandates';
ALTER TYPE "EventObjectType" ADD VALUE 'mandate_details';
ALTER TYPE "EventType" ADD VALUE 'mandate_active';
ALTER TYPE "EventType" ADD VALUE 'mandate_revoked';
| 56 | 126 |
hyperswitch
|
migrations/2023-10-05-130917_add_mandate_webhook_types/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
Select 1;
| 15 | 127 |
hyperswitch
|
migrations/2023-04-06-063047_add_connector_col_in_dispute/up.sql
|
.sql
|
-- Your SQL goes here
ALTER TABLE dispute
ADD COLUMN connector VARCHAR(255) NOT NULL;
| 22 | 128 |
hyperswitch
|
migrations/2023-04-06-063047_add_connector_col_in_dispute/down.sql
|
.sql
|
ALTER TABLE dispute DROP COLUMN connector;
| 7 | 129 |
hyperswitch
|
migrations/2023-07-17-111427_add-fraud-check-table.sql/up.sql
|
.sql
|
-- Your SQL goes here-- Your SQL goes here
CREATE TYPE "FraudCheckType" AS ENUM (
'pre_frm',
'post_frm'
);
CREATE TYPE "FraudCheckStatus" AS ENUM (
'fraud',
'manual_review',
'pending',
'legit',
'transaction_failure'
);
CREATE TABLE fraud_check (
frm_id VARCHAR(64) NOT NULL UNIQUE,
payment_id VARCHAR(64) NOT NULL,
merchant_id VARCHAR(64) NOT NULL,
attempt_id VARCHAR(64) NOT NULL UNIQUE,
created_at TIMESTAMP NOT NULL DEFAULT now(),
frm_name VARCHAR(255) NOT NULL,
frm_transaction_id VARCHAR(255) UNIQUE,
frm_transaction_type "FraudCheckType" NOT NULL,
frm_status "FraudCheckStatus" NOT NULL,
frm_score INTEGER,
frm_reason JSONB,
frm_error VARCHAR(255),
payment_details JSONB,
metadata JSONB,
modified_at TIMESTAMP NOT NULL DEFAULT now(),
PRIMARY KEY (frm_id, attempt_id, payment_id, merchant_id)
);
CREATE UNIQUE INDEX frm_id_index ON fraud_check (frm_id, attempt_id, payment_id, merchant_id);
| 257 | 130 |
hyperswitch
|
migrations/2023-07-17-111427_add-fraud-check-table.sql/down.sql
|
.sql
|
DROP TABLE fraud_check;
DROP TYPE "FraudCheckType";
DROP TYPE "FraudCheckStatus";
| 21 | 131 |
hyperswitch
|
migrations/2023-05-02-102332_payout_create/up.sql
|
.sql
|
CREATE type "PayoutStatus" AS ENUM (
'success',
'failed',
'cancelled',
'pending',
'ineligible',
'requires_creation',
'requires_payout_method_data',
'requires_fulfillment'
);
CREATE type "PayoutType" AS ENUM ('card', 'bank');
CREATE TABLE
PAYOUT_ATTEMPT (
payout_attempt_id VARCHAR (64) NOT NULL PRIMARY KEY,
payout_id VARCHAR (64) NOT NULL,
customer_id VARCHAR (64) NOT NULL,
merchant_id VARCHAR (64) NOT NULL,
address_id VARCHAR (64) NOT NULL,
connector VARCHAR (64) NOT NULL,
connector_payout_id VARCHAR (128) NOT NULL,
payout_token VARCHAR (64),
status "PayoutStatus" NOT NULL,
is_eligible BOOLEAN,
error_message TEXT,
error_code VARCHAR (64),
business_country "CountryAlpha2",
business_label VARCHAR(64),
created_at timestamp NOT NULL DEFAULT NOW():: timestamp,
last_modified_at timestamp NOT NULL DEFAULT NOW():: timestamp
);
CREATE TABLE
PAYOUTS (
payout_id VARCHAR (64) NOT NULL PRIMARY KEY,
merchant_id VARCHAR (64) NOT NULL,
customer_id VARCHAR (64) NOT NULL,
address_id VARCHAR (64) NOT NULL,
payout_type "PayoutType" NOT NULL,
payout_method_id VARCHAR (64),
amount BIGINT NOT NULL,
destination_currency "Currency" NOT NULL,
source_currency "Currency" NOT NULL,
description VARCHAR (255),
recurring BOOLEAN NOT NULL,
auto_fulfill BOOLEAN NOT NULL,
return_url VARCHAR (255),
entity_type VARCHAR (64) NOT NULL,
metadata JSONB DEFAULT '{}':: JSONB,
created_at timestamp NOT NULL DEFAULT NOW():: timestamp,
last_modified_at timestamp NOT NULL DEFAULT NOW():: timestamp
);
CREATE UNIQUE INDEX payout_attempt_index ON PAYOUT_ATTEMPT (
merchant_id,
payout_attempt_id,
payout_id
);
CREATE UNIQUE INDEX payouts_index ON PAYOUTS (merchant_id, payout_id);
-- Alterations
ALTER TABLE merchant_account
ADD
COLUMN payout_routing_algorithm JSONB;
ALTER TABLE locker_mock_up ADD COLUMN enc_card_data TEXT;
ALTER TYPE "ConnectorType" ADD VALUE 'payout_processor';
| 506 | 132 |
hyperswitch
|
migrations/2023-05-02-102332_payout_create/down.sql
|
.sql
|
DROP TABLE PAYOUT_ATTEMPT;
DROP TABLE PAYOUTS;
DROP TYPE "PayoutStatus";
DROP TYPE "PayoutType";
-- Alterations
ALTER TABLE
merchant_account DROP COLUMN payout_routing_algorithm;
ALTER TABLE locker_mock_up DROP COLUMN enc_card_data;
DELETE FROM pg_enum
WHERE
enumlabel = 'payout_processor'
AND enumtypid = (
SELECT oid
FROM pg_type
WHERE typname = 'ConnectorType'
)
| 98 | 133 |
hyperswitch
|
migrations/2024-08-29-135449_add_version_to_business_profile/up.sql
|
.sql
|
-- Your SQL goes here
ALTER TABLE business_profile
ADD COLUMN version "ApiVersion" DEFAULT 'v1' NOT NULL;
| 26 | 134 |
hyperswitch
|
migrations/2024-08-29-135449_add_version_to_business_profile/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
ALTER TABLE business_profile DROP COLUMN version;
| 19 | 135 |
hyperswitch
|
migrations/2023-06-29-094858_payment-intent-remove-udf-field/up.sql
|
.sql
|
-- Your SQL goes here
ALTER TABLE payment_intent DROP COLUMN udf;
| 15 | 136 |
hyperswitch
|
migrations/2023-06-29-094858_payment-intent-remove-udf-field/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
ALTER TABLE payment_intent ADD COLUMN udf JSONB;
| 22 | 137 |
hyperswitch
|
migrations/2023-09-06-101704_payment_method_data_in_payment_methods/up.sql
|
.sql
|
-- Your SQL goes here
ALTER TABLE payment_methods ADD COLUMN IF NOT EXISTS payment_method_data BYTEA DEFAULT NULL;
| 23 | 138 |
hyperswitch
|
migrations/2023-09-06-101704_payment_method_data_in_payment_methods/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
ALTER TABLE payment_methods DROP COLUMN IF EXISTS payment_method_data;
| 23 | 139 |
hyperswitch
|
migrations/2024-11-13-105952_add_call-back-mapper_table/up.sql
|
.sql
|
-- Your SQL goes here
CREATE TABLE IF NOT EXISTS callback_mapper (
id VARCHAR(128) NOT NULL,
type VARCHAR(64) NOT NULL,
data JSONB NOT NULL,
created_at TIMESTAMP NOT NULL,
last_modified_at TIMESTAMP NOT NULL,
PRIMARY KEY (id, type)
);
| 66 | 140 |
hyperswitch
|
migrations/2024-11-13-105952_add_call-back-mapper_table/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
DROP TABLE IF EXISTS callback_mapper;
| 18 | 141 |
hyperswitch
|
migrations/2024-08-27-190822_add_tax_processor_in_connector_type/up.sql
|
.sql
|
-- Your SQL goes here
ALTER TYPE "ConnectorType"
ADD VALUE IF NOT EXISTS 'tax_processor';
| 21 | 142 |
hyperswitch
|
migrations/2024-08-27-190822_add_tax_processor_in_connector_type/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
select 1;
| 15 | 143 |
hyperswitch
|
migrations/2023-05-03-121025_nest_straight_through_col_in_payment_attempt/up.sql
|
.sql
|
-- Your SQL goes here
UPDATE payment_attempt
SET straight_through_algorithm = jsonb_build_object('algorithm', straight_through_algorithm);
| 26 | 144 |
hyperswitch
|
migrations/2023-05-03-121025_nest_straight_through_col_in_payment_attempt/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
UPDATE payment_attempt
SET straight_through_algorithm = CASE WHEN straight_through_algorithm->>'algorithm' IS NULL THEN
NULL
ELSE
straight_through_algorithm->'algorithm'
END;
| 48 | 145 |
hyperswitch
|
migrations/2024-08-28-044317_add_skip_external_tax_calcualtion_in_payment_intent_table/up.sql
|
.sql
|
-- Your SQL goes here
ALTER TABLE payment_intent ADD COLUMN IF NOT EXISTS skip_external_tax_calculation BOOLEAN;
| 22 | 146 |
hyperswitch
|
migrations/2024-08-28-044317_add_skip_external_tax_calcualtion_in_payment_intent_table/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
ALTER TABLE payment_intent DROP COLUMN if EXISTS skip_external_tax_calculation;
| 25 | 147 |
hyperswitch
|
migrations/2024-07-18-120134_create_additional_fields_in_organization_table/up.sql
|
.sql
|
-- Your SQL goes here
ALTER TABLE organization
ADD COLUMN organization_details jsonb,
ADD COLUMN metadata jsonb,
ADD created_at TIMESTAMP NOT NULL DEFAULT now()::TIMESTAMP,
ADD modified_at TIMESTAMP NOT NULL DEFAULT now()::TIMESTAMP;
| 49 | 148 |
hyperswitch
|
migrations/2024-07-18-120134_create_additional_fields_in_organization_table/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
ALTER TABLE organization
DROP COLUMN organization_details,
DROP COLUMN metadata,
DROP created_at,
DROP modified_at;
| 32 | 149 |
hyperswitch
|
migrations/2024-07-31-063531_alter_customer_id_in_payouts/up.sql
|
.sql
|
ALTER TABLE payouts
ALTER COLUMN customer_id
DROP NOT NULL,
ALTER COLUMN address_id
DROP NOT NULL;
ALTER TABLE payout_attempt
ALTER COLUMN customer_id
DROP NOT NULL,
ALTER COLUMN address_id
DROP NOT NULL;
| 45 | 150 |
hyperswitch
|
migrations/2024-07-31-063531_alter_customer_id_in_payouts/down.sql
|
.sql
|
ALTER TABLE payouts
ALTER COLUMN customer_id
SET
NOT NULL,
ALTER COLUMN address_id
SET
NOT NULL;
ALTER TABLE payout_attempt
ALTER COLUMN customer_id
SET
NOT NULL,
ALTER COLUMN address_id
SET
NOT NULL;
| 53 | 151 |
hyperswitch
|
migrations/2024-11-22-091336_add_split_payments_in_payment_intent/up.sql
|
.sql
|
-- Your SQL goes here
ALTER TABLE payment_intent ADD COLUMN IF NOT EXISTS split_payments jsonb;
| 20 | 152 |
hyperswitch
|
migrations/2024-11-22-091336_add_split_payments_in_payment_intent/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
ALTER TABLE payment_intent DROP COLUMN IF EXISTS split_payments;
| 22 | 153 |
hyperswitch
|
migrations/2024-09-02-112941_add_version_in_payment_methods/up.sql
|
.sql
|
-- Your SQL goes here
ALTER TABLE payment_methods
ADD COLUMN IF NOT EXISTS version "ApiVersion" NOT NULL DEFAULT 'v1';
| 28 | 154 |
hyperswitch
|
migrations/2024-09-02-112941_add_version_in_payment_methods/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
ALTER TABLE payment_methods DROP COLUMN IF EXISTS version;
| 21 | 155 |
hyperswitch
|
migrations/2024-05-10-074332_add_frm_metadata_to_payment_intent/up.sql
|
.sql
|
-- Your SQL goes here
ALTER TABLE payment_intent ADD COLUMN IF NOT EXISTS frm_metadata JSONB DEFAULT NULL;
| 22 | 156 |
hyperswitch
|
migrations/2024-05-10-074332_add_frm_metadata_to_payment_intent/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
ALTER TABLE payment_intent DROP COLUMN IF EXISTS frm_metadata;
| 22 | 157 |
hyperswitch
|
migrations/2024-05-14-092623_add_updated_by_column/up.sql
|
.sql
|
-- Your SQL goes here
ALTER TABLE payment_methods ADD COLUMN IF NOT EXISTS updated_by VARCHAR(64);
ALTER TABLE mandate ADD COLUMN IF NOT EXISTS updated_by VARCHAR(64);
ALTER TABLE customers ADD COLUMN IF NOT EXISTS updated_by VARCHAR(64);
| 52 | 158 |
hyperswitch
|
migrations/2024-05-14-092623_add_updated_by_column/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
ALTER TABLE payment_methods DROP COLUMN IF EXISTS updated_by;
ALTER TABLE mandate DROP COLUMN IF EXISTS updated_by;
ALTER TABLE customers DROP COLUMN IF EXISTS updated_by;
| 42 | 159 |
hyperswitch
|
migrations/2023-02-01-135102_create_api_keys_table/up.sql
|
.sql
|
CREATE TABLE api_keys (
key_id VARCHAR(64) NOT NULL PRIMARY KEY,
merchant_id VARCHAR(64) NOT NULL,
NAME VARCHAR(64) NOT NULL,
description VARCHAR(256) DEFAULT NULL,
hash_key VARCHAR(64) NOT NULL,
hashed_api_key VARCHAR(128) NOT NULL,
prefix VARCHAR(16) NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT now()::TIMESTAMP,
expires_at TIMESTAMP DEFAULT NULL,
last_used TIMESTAMP DEFAULT NULL
);
| 112 | 160 |
hyperswitch
|
migrations/2023-02-01-135102_create_api_keys_table/down.sql
|
.sql
|
DROP TABLE api_keys;
| 5 | 161 |
hyperswitch
|
migrations/2023-08-31-093852_add_merchant_decision/up.sql
|
.sql
|
alter table payment_intent add column merchant_decision VARCHAR(64);
| 13 | 162 |
hyperswitch
|
migrations/2023-08-31-093852_add_merchant_decision/down.sql
|
.sql
|
alter table payment_intent drop column merchant_decision;
| 9 | 163 |
hyperswitch
|
migrations/2022-10-26-101016_update_payment_attempt_status_intent_status/up.sql
|
.sql
|
-- Your SQL goes here
ALTER TABLE payment_attempt ADD IF NOT EXISTS amount_to_capture INTEGER;
ALTER TYPE "CaptureMethod" ADD VALUE 'manual_multiple' AFTER 'manual';
ALTER TYPE "IntentStatus" ADD VALUE 'requires_capture';
| 47 | 164 |
hyperswitch
|
migrations/2022-10-26-101016_update_payment_attempt_status_intent_status/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
ALTER TABLE payment_attempt DROP COLUMN IF EXISTS amount_to_capture;
| 23 | 165 |
hyperswitch
|
migrations/2023-08-23-090712_payment_attempt_perf_idx/up.sql
|
.sql
|
-- Your SQL goes here
CREATE INDEX payment_attempt_attempt_id_merchant_id_index ON payment_attempt (attempt_id, merchant_id);
| 26 | 166 |
hyperswitch
|
migrations/2023-08-23-090712_payment_attempt_perf_idx/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
DROP INDEX IF EXISTS payment_attempt_attempt_id_merchant_id_index;
| 24 | 167 |
hyperswitch
|
migrations/2024-07-03-182616_add_merchant_order_reference_id/up.sql
|
.sql
|
-- Your SQL goes here
ALTER TABLE payment_intent ADD COLUMN IF NOT EXISTS merchant_order_reference_id VARCHAR(255) DEFAULT NULL;
| 28 | 168 |
hyperswitch
|
migrations/2024-07-03-182616_add_merchant_order_reference_id/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
ALTER TABLE payment_intent DROP COLUMN IF EXISTS merchant_order_reference_id;
| 24 | 169 |
hyperswitch
|
migrations/2024-04-09-202926_add_confirm_to_payouts/up.sql
|
.sql
|
ALTER TABLE payouts ADD COLUMN IF NOT EXISTS confirm bool;
| 11 | 170 |
hyperswitch
|
migrations/2024-04-09-202926_add_confirm_to_payouts/down.sql
|
.sql
|
ALTER TABLE payouts DROP COLUMN IF EXISTS confirm;
| 9 | 171 |
hyperswitch
|
migrations/2023-04-13-094917_change_primary_business_type/up.sql
|
.sql
|
-- This change will allow older merchant accounts to be used with new changes
UPDATE merchant_account
SET primary_business_details = '[{"country": "US", "business": "default"}]';
-- Since this field is optional, default is not required
ALTER TABLE merchant_connector_account
ALTER COLUMN business_sub_label DROP DEFAULT;
| 65 | 172 |
hyperswitch
|
migrations/2023-04-13-094917_change_primary_business_type/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
UPDATE merchant_account
SET primary_business_details = '{"country": ["US"], "business": ["default"]}';
ALTER TABLE merchant_connector_account
ALTER COLUMN business_sub_label
SET DEFAULT 'default';
| 50 | 173 |
hyperswitch
|
migrations/2024-01-02-111223_users_preferred_merchant_column/up.sql
|
.sql
|
-- Your SQL goes here
ALTER TABLE users ADD COLUMN preferred_merchant_id VARCHAR(64);
| 20 | 174 |
hyperswitch
|
migrations/2024-01-02-111223_users_preferred_merchant_column/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
ALTER TABLE users DROP COLUMN preferred_merchant_id;
| 21 | 175 |
hyperswitch
|
migrations/2023-12-18-062613_create_blocklist_lookup_table/up.sql
|
.sql
|
-- Your SQL goes here
CREATE TABLE blocklist_lookup (
id SERIAL PRIMARY KEY,
merchant_id VARCHAR(64) NOT NULL,
fingerprint TEXT NOT NULL
);
CREATE UNIQUE INDEX blocklist_lookup_merchant_id_fingerprint_index ON blocklist_lookup (merchant_id, fingerprint);
| 58 | 176 |
hyperswitch
|
migrations/2023-12-18-062613_create_blocklist_lookup_table/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
DROP TABLE blocklist_lookup;
| 17 | 177 |
hyperswitch
|
migrations/2024-05-21-065403_add_ds_trans_id_to_authentication_table/up.sql
|
.sql
|
-- Your SQL goes here
ALTER TABLE authentication ADD COLUMN IF NOT EXISTS ds_trans_id VARCHAR(64);
| 22 | 178 |
hyperswitch
|
migrations/2024-05-21-065403_add_ds_trans_id_to_authentication_table/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
ALTER TABLE authentication DROP COLUMN If EXISTS ds_trans_id;
| 22 | 179 |
hyperswitch
|
migrations/2024-11-14-084429_add_sca_exemption_field_to_payment_intent/up.sql
|
.sql
|
CREATE TYPE "ScaExemptionType" AS ENUM (
'low_value',
'transaction_risk_analysis'
);
ALTER TABLE payment_intent ADD COLUMN IF NOT EXISTS psd2_sca_exemption_type "ScaExemptionType";
| 49 | 180 |
hyperswitch
|
migrations/2024-11-14-084429_add_sca_exemption_field_to_payment_intent/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
ALTER TABLE payment_intent DROP COLUMN psd2_sca_exemption_type;
DROP TYPE "ScaExemptionType";
| 35 | 181 |
hyperswitch
|
migrations/2024-05-07-080628_user_totp/up.sql
|
.sql
|
-- Your SQL goes here
CREATE TYPE "TotpStatus" AS ENUM (
'set',
'in_progress',
'not_set'
);
ALTER TABLE users ADD COLUMN IF NOT EXISTS totp_status "TotpStatus" DEFAULT 'not_set' NOT NULL;
ALTER TABLE users ADD COLUMN IF NOT EXISTS totp_secret bytea DEFAULT NULL;
ALTER TABLE users ADD COLUMN IF NOT EXISTS totp_recovery_codes TEXT[] DEFAULT NULL;
| 88 | 182 |
hyperswitch
|
migrations/2024-05-07-080628_user_totp/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
ALTER TABLE users DROP COLUMN totp_status;
ALTER TABLE users DROP COLUMN totp_secret;
ALTER TABLE users DROP COLUMN totp_recovery_codes;
DROP TYPE "TotpStatus";
| 46 | 183 |
hyperswitch
|
migrations/2024-12-05-115544_add-service-details/up.sql
|
.sql
|
-- Your SQL goes here
ALTER TABLE authentication
ADD COLUMN IF NOT EXISTS service_details JSONB
DEFAULT NULL;
| 23 | 184 |
hyperswitch
|
migrations/2024-12-05-115544_add-service-details/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
ALTER TABLE authentication DROP COLUMN IF EXISTS service_details;
| 21 | 185 |
hyperswitch
|
migrations/2023-06-14-105035_add_reason_in_payment_attempt/up.sql
|
.sql
|
ALTER TABLE payment_attempt
ADD COLUMN error_reason TEXT;
| 11 | 186 |
hyperswitch
|
migrations/2023-06-14-105035_add_reason_in_payment_attempt/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
ALTER TABLE payment_attempt
DROP COLUMN error_reason;
| 21 | 187 |
hyperswitch
|
migrations/2024-07-10-065816_add_custom_outgoing_webhook_http_headers_to_business_profile/up.sql
|
.sql
|
ALTER TABLE business_profile ADD COLUMN IF NOT EXISTS outgoing_webhook_custom_http_headers BYTEA DEFAULT NULL;
| 20 | 188 |
hyperswitch
|
migrations/2024-07-10-065816_add_custom_outgoing_webhook_http_headers_to_business_profile/down.sql
|
.sql
|
ALTER TABLE business_profile DROP COLUMN IF EXISTS outgoing_webhook_custom_http_headers;
| 15 | 189 |
hyperswitch
|
migrations/2024-04-10-034442_alter_payout_status/up.sql
|
.sql
|
ALTER TYPE "PayoutStatus" ADD VALUE IF NOT EXISTS 'requires_vendor_account_creation';
| 18 | 190 |
hyperswitch
|
migrations/2024-04-10-034442_alter_payout_status/down.sql
|
.sql
|
SELECT 1;
| 4 | 191 |
hyperswitch
|
migrations/2023-01-20-113235_add_attempt_id_to_payment_intent/up.sql
|
.sql
|
-- Your SQL goes here
ALTER TABLE payment_intent ADD COLUMN active_attempt_id VARCHAR(64) NOT NULL DEFAULT 'xxx';
UPDATE payment_intent SET active_attempt_id = payment_attempt.attempt_id from payment_attempt where payment_intent.active_attempt_id = payment_attempt.payment_id;
CREATE UNIQUE INDEX payment_attempt_payment_id_merchant_id_attempt_id_index ON payment_attempt (payment_id, merchant_id, attempt_id);
-- Because payment_attempt table can have rows with same payment_id and merchant_id, this index is dropped.
DROP index payment_attempt_payment_id_merchant_id_index;
CREATE INDEX payment_attempt_payment_id_merchant_id_index ON payment_attempt (payment_id, merchant_id);
| 132 | 192 |
hyperswitch
|
migrations/2023-01-20-113235_add_attempt_id_to_payment_intent/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
DROP INDEX payment_attempt_payment_id_merchant_id_index;
CREATE UNIQUE INDEX payment_attempt_payment_id_merchant_id_index ON payment_attempt (payment_id, merchant_id);
DROP INDEX payment_attempt_payment_id_merchant_id_attempt_id_index;
ALTER TABLE PAYMENT_INTENT DROP COLUMN active_attempt_id;
| 68 | 193 |
hyperswitch
|
migrations/2023-06-19-071300_merchant_key_store_shrink_merchant_id/up.sql
|
.sql
|
ALTER TABLE merchant_key_store
ALTER COLUMN merchant_id TYPE VARCHAR(64);
| 16 | 194 |
hyperswitch
|
migrations/2023-06-19-071300_merchant_key_store_shrink_merchant_id/down.sql
|
.sql
|
ALTER TABLE merchant_key_store
ALTER COLUMN merchant_id TYPE VARCHAR(255);
| 17 | 195 |
hyperswitch
|
migrations/2024-10-17-123943_add-profile-enum-in-role-scope/up.sql
|
.sql
|
-- Your SQL goes here
ALTER TYPE "RoleScope"
ADD VALUE IF NOT EXISTS 'profile';
| 20 | 196 |
hyperswitch
|
migrations/2024-10-17-123943_add-profile-enum-in-role-scope/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
SELECT 1;
| 15 | 197 |
hyperswitch
|
migrations/2024-02-08-142804_add_mandate_data_payment_attempt/up.sql
|
.sql
|
-- Your SQL goes here
ALTER TABLE payment_attempt
ADD COLUMN IF NOT EXISTS mandate_data JSONB DEFAULT NULL;
| 23 | 198 |
hyperswitch
|
migrations/2024-02-08-142804_add_mandate_data_payment_attempt/down.sql
|
.sql
|
-- This file should undo anything in `up.sql`
ALTER TABLE payment_attempt DROP COLUMN IF EXISTS mandate_data;
| 22 | 199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.