lab4 done

This commit is contained in:
Khakimov Dmitrij
2026-10-28 22:41:10 +03:00
parent a7bedda183
commit dbc700fafe
75 changed files with 5611 additions and 227 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);