teldrive/pkg/database/migrations/20240120151952_modify_constraint.sql
2024-01-20 15:45:16 +05:30

6 lines
No EOL
303 B
SQL

-- +goose Up
-- +goose StatementBegin
ALTER TABLE teldrive.bots DROP CONSTRAINT IF EXISTS btoken_user_un;
ALTER TABLE teldrive.bots DROP CONSTRAINT IF EXISTS btoken_user_channel_un;
ALTER TABLE teldrive.bots ADD CONSTRAINT btoken_user_channel_un UNIQUE (user_id,token,channel_id);
-- +goose StatementEnd