Files
mtusi2026lab4/migrations/000004_attachment_messages.up.sql
T

6 lines
315 B
SQL

-- Row CHECK cannot inspect message_attachments. The service enforces
-- nonblank text OR at least one attachment, inserted in the same transaction.
ALTER TABLE messages DROP CONSTRAINT messages_text_length;
ALTER TABLE messages ADD CONSTRAINT messages_text_length
CHECK (char_length(text) BETWEEN 0 AND 4000);