feat: add storage and media table
This commit is contained in:
23
backend/database/migrations/20250110093636_create_medias.sql
Normal file
23
backend/database/migrations/20250110093636_create_medias.sql
Normal file
@@ -0,0 +1,23 @@
|
||||
-- +goose Up
|
||||
-- +goose StatementBegin
|
||||
-- create medias table
|
||||
CREATE TABLE medias (
|
||||
id SERIAL8 PRIMARY KEY,
|
||||
created_at timestamp NOT NULL default now(),
|
||||
updated_at timestamp NOT NULL default now(),
|
||||
|
||||
user_id INT8 NOT NULL,
|
||||
post_id INT8 NOT NULL,
|
||||
storage_id INT8 NOT NULL,
|
||||
name VARCHAR(255) NOT NULL default '',
|
||||
uuid VARCHAR(128) NOT NULL,
|
||||
mime_type VARCHAR(128) NOT NULL default '',
|
||||
size INT8 NOT NULL default 0,
|
||||
path VARCHAR(255) NOT NULL default ''
|
||||
);
|
||||
-- +goose StatementEnd
|
||||
|
||||
-- +goose Down
|
||||
-- +goose StatementBegin
|
||||
DROP TABLE medias;
|
||||
-- +goose StatementEnd
|
||||
Reference in New Issue
Block a user