-- An operator must first remove attachment-only messages before this rollback. ALTER TABLE messages DROP CONSTRAINT messages_text_check; ALTER TABLE messages ADD CONSTRAINT messages_text_check CHECK (char_length(text) BETWEEN 1 AND 4000); DROP TABLE message_attachments; DROP TABLE attachments;