forked from mtusi2026/mtusi2026lab5
14 lines
351 B
SQL
14 lines
351 B
SQL
|
|
-- Lab4: messages with attachments may have empty text.
|
|
-- The API checks that a message contains text or attachments.
|
|
|
|
ALTER TABLE messages
|
|
DROP CONSTRAINT IF EXISTS message_length;
|
|
|
|
ALTER TABLE messages
|
|
DROP CONSTRAINT IF EXISTS message_not_blank;
|
|
|
|
ALTER TABLE messages
|
|
ADD CONSTRAINT message_length
|
|
CHECK (char_length(text) <= 4000);
|