.
This commit is contained in:
16
migrations/20250510184916_file.up.sql
Normal file
16
migrations/20250510184916_file.up.sql
Normal file
@@ -0,0 +1,16 @@
|
||||
CREATE TABLE IF NOT EXISTS "file"
|
||||
(
|
||||
"id" UUID NOT NULL PRIMARY KEY DEFAULT uuid_generate_v7(),
|
||||
"filename" VARCHAR NOT NULL,
|
||||
"content_type" VARCHAR NOT NULL,
|
||||
"url" VARCHAR NOT NULL,
|
||||
"size" INT8 NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "message_attachment"
|
||||
(
|
||||
"message_id" UUID NOT NULL REFERENCES "message" ON DELETE CASCADE,
|
||||
"attachment_id" UUID NOT NULL REFERENCES "file" ON DELETE CASCADE,
|
||||
"order" INT2 NOT NULL,
|
||||
PRIMARY KEY ("message_id", "attachment_id")
|
||||
);
|
||||
Reference in New Issue
Block a user