mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 21:41:55 +00:00
15 lines
519 B
SQL
15 lines
519 B
SQL
CREATE TABLE documents (
|
|
id BIGSERIAL PRIMARY KEY,
|
|
documentable_type VARCHAR(50) NOT NULL,
|
|
documentable_id BIGINT NOT NULL,
|
|
type VARCHAR(50) NOT NULL,
|
|
path VARCHAR(50) NOT NULL,
|
|
name VARCHAR(50) NOT NULL,
|
|
ext VARCHAR(50) NOT NULL,
|
|
size NUMERIC(15, 3) NOT NULL,
|
|
created_by BIGINT REFERENCES users (id) ON DELETE RESTRICT ON UPDATE CASCADE,
|
|
created_at TIMESTAMPTZ DEFAULT now()
|
|
);
|
|
|
|
CREATE INDEX documents_documentable_polymorphic ON documents (documentable_type, documentable_id);
|