lab4 done

This commit is contained in:
Khakimov Dmitrij
2026-11-10 20:42:03 +03:00
parent 276dbdad8a
commit b2bd7501d3
129 changed files with 9319 additions and 109 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);