fix: removed user_id, type unique for wallets
This commit is contained in:
parent
459ebcc63b
commit
065e66e820
|
|
@ -91,9 +91,7 @@ VALUES (
|
|||
TRUE,
|
||||
CURRENT_TIMESTAMP,
|
||||
CURRENT_TIMESTAMP
|
||||
) ON CONFLICT (user_id, type) DO
|
||||
UPDATE
|
||||
SET updated_at = EXCLUDED.updated_at
|
||||
)
|
||||
RETURNING id INTO STRICT _company_wallet_id;
|
||||
INSERT INTO companies (
|
||||
name,
|
||||
|
|
@ -144,9 +142,7 @@ VALUES (
|
|||
TRUE,
|
||||
CURRENT_TIMESTAMP,
|
||||
CURRENT_TIMESTAMP
|
||||
) ON CONFLICT (user_id, type) DO
|
||||
UPDATE
|
||||
SET updated_at = EXCLUDED.updated_at
|
||||
)
|
||||
RETURNING id INTO STRICT _branch_wallet_id;
|
||||
INSERT INTO branches (
|
||||
name,
|
||||
|
|
|
|||
|
|
@ -73,7 +73,6 @@ CREATE TABLE IF NOT EXISTS wallets (
|
|||
is_active BOOLEAN NOT NULL DEFAULT true,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
UNIQUE(user_id, type),
|
||||
CONSTRAINT balance_positve CHECK (balance >= 0)
|
||||
);
|
||||
CREATE TABLE refresh_tokens (
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user