-- Lab4 contract: a message may carry text = "" when it references at least one -- attachment of the chat (contracts/README.md, "Вложения"). The HTTP handler -- still rejects empty or blank text without attachments; the database -- constraint only widens to permit the documented attachment-only message. ALTER TABLE messages DROP CONSTRAINT messages_text_length; ALTER TABLE messages ADD CONSTRAINT messages_text_length CHECK (char_length(text) BETWEEN 0 AND 4000);