Files
spsays-bff/migrations/0054_stickers.down.sql
2026-08-30 02:18:53 +05:30

15 lines
645 B
SQL

DELETE FROM message_attachments WHERE kind = 'sticker';
ALTER TABLE message_attachments DROP CONSTRAINT IF EXISTS message_attachments_kind_check;
ALTER TABLE message_attachments
ADD CONSTRAINT message_attachments_kind_check
CHECK (kind IN ('image', 'video', 'audio', 'file', 'link', 'entity', 'quote'));
ALTER TABLE message_attachments DROP CONSTRAINT IF EXISTS message_attachments_entity_type_check;
ALTER TABLE message_attachments
ADD CONSTRAINT message_attachments_entity_type_check
CHECK (entity_type IS NULL OR
entity_type IN ('post', 'comment', 'profile', 'collection'));
DROP TABLE IF EXISTS saved_stickers;