lab6 done

This commit is contained in:
Khakimov Dmitrij
2026-11-18 21:37:25 +03:00
parent 470d9d6f1e
commit 4ab9b0ef9a
158 changed files with 21115 additions and 52 deletions
+13
View File
@@ -0,0 +1,13 @@
-- +goose Up
ALTER TABLE messages
DROP CONSTRAINT IF EXISTS messages_text_check,
ADD CONSTRAINT messages_text_check CHECK (char_length(text) BETWEEN 0 AND 4000),
ADD COLUMN IF NOT EXISTS attachment_ids uuid[] NOT NULL DEFAULT '{}';
-- +goose Down
-- Attachment-only messages cannot exist in lab3; retain an explicit placeholder when downgrading.
UPDATE messages SET text='[attachment]' WHERE text='';
ALTER TABLE messages
DROP COLUMN IF EXISTS attachment_ids,
DROP CONSTRAINT IF EXISTS messages_text_check,
ADD CONSTRAINT messages_text_check CHECK (char_length(text) BETWEEN 1 AND 4000);