2022-12-10 12:32:12 +01:00
|
|
|
CREATE TABLE notes (
|
2022-12-06 02:40:42 +01:00
|
|
|
id BIGSERIAL PRIMARY KEY,
|
2022-12-18 17:38:19 +01:00
|
|
|
account_id BIGINT REFERENCES accounts (id),
|
2022-12-06 02:40:42 +01:00
|
|
|
uri VARCHAR,
|
|
|
|
content TEXT NOT NULL,
|
2022-12-18 17:38:19 +01:00
|
|
|
source TEXT DEFAULT NULL,
|
2022-12-06 02:40:42 +01:00
|
|
|
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);
|
|
|
|
CREATE UNIQUE INDEX index_notes_on_uri ON notes (uri);
|
2022-12-10 12:32:12 +01:00
|
|
|
CREATE INDEX index_notes_on_created_at ON notes (created_at);
|