nyanoblog/migrations/20221205235226_create_notes.sql

17 lines
569 B
MySQL
Raw Permalink Normal View History

CREATE TABLE notes (
id BIGSERIAL PRIMARY KEY,
2022-12-18 17:38:19 +01:00
account_id BIGINT REFERENCES accounts (id),
2022-12-25 15:57:33 +01:00
iri VARCHAR,
content TEXT NOT NULL,
2022-12-18 17:38:19 +01:00
source TEXT DEFAULT NULL,
2022-12-27 02:30:03 +01:00
content_type VARCHAR DEFAULT NULL,
summary TEXT DEFAULT NULL,
sensitive BOOLEAN NOT NULL DEFAULT FALSE,
created_at TIMESTAMP NOT NULL DEFAULT now(),
updated_at TIMESTAMP NOT NULL DEFAULT now()
);
2022-12-18 17:38:19 +01:00
CREATE INDEX index_notes_on_account_id ON notes (account_id);
2022-12-25 15:57:33 +01:00
CREATE UNIQUE INDEX index_notes_on_iri ON notes (iri);
CREATE INDEX index_notes_on_created_at ON notes (created_at);