DROP TABLE message_attachments; DROP TABLE attachments; ALTER TABLE messages DROP CONSTRAINT text_length; ALTER TABLE messages ADD CONSTRAINT text_length CHECK (char_length(text) BETWEEN 1 AND 4000);