nyanoblog/migrations/20221205235226_create_notes.sql
fef c227d09af3
rename statuses to notes
This matches the ActivityPub terminology, so why
not do it as long as it's still possible to
arbitrarily change the database schema.
2022-12-10 12:32:12 +01:00

12 lines
382 B
SQL

CREATE TABLE notes (
id BIGSERIAL PRIMARY KEY,
account_id BIGINT REFERENCES accounts(id),
uri VARCHAR,
content TEXT NOT 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()
);
CREATE INDEX index_notes_on_created_at ON notes (created_at);