ALTER TABLE messages ADD CONSTRAINT messages_text_not_blank CHECK (length(btrim(text)) > 0); DROP TABLE message_attachments; DROP TABLE attachments;