fix: referral_program_settings FK on fresh database
commission_wallet_type_id defaulted to 2 but USDT_TRC20 is id 1 on empty DB; seed row from wallet_types instead. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
71db1a9718
commit
16d2c50a30
@ -812,11 +812,13 @@ CREATE TABLE IF NOT EXISTS referral_program_settings (
|
||||
referrer_must_be_verified BOOLEAN NOT NULL DEFAULT TRUE,
|
||||
referrer_must_have_deposited BOOLEAN NOT NULL DEFAULT TRUE,
|
||||
min_first_deposit_raw BIGINT NOT NULL DEFAULT 0,
|
||||
commission_wallet_type_id INTEGER NOT NULL REFERENCES wallet_types(id) DEFAULT 2,
|
||||
commission_wallet_type_id INTEGER NOT NULL REFERENCES wallet_types(id),
|
||||
updated_at TIMESTAMPTZ DEFAULT NOW()
|
||||
);
|
||||
|
||||
INSERT INTO referral_program_settings (id) VALUES (1) ON CONFLICT (id) DO NOTHING;
|
||||
INSERT INTO referral_program_settings (id, commission_wallet_type_id)
|
||||
SELECT 1, id FROM wallet_types WHERE code = 'USDT_TRC20'
|
||||
ON CONFLICT (id) DO NOTHING;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS referral_levels (
|
||||
level_number INTEGER PRIMARY KEY CHECK (level_number >= 1),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user