db: add NOT NULL constraints

This commit is contained in:
Astro 2022-12-20 03:48:14 +01:00
parent 6aeab7f7aa
commit ce5add113f

View file

@ -4,7 +4,7 @@ use tokio_postgres::{Client, Error, NoTls, Statement};
const CREATE_SCHEMA_COMMANDS: &[&str] = &[ const CREATE_SCHEMA_COMMANDS: &[&str] = &[
"CREATE TABLE IF NOT EXISTS follows (id TEXT, inbox TEXT, actor TEXT, UNIQUE (inbox, actor))", "CREATE TABLE IF NOT EXISTS follows (id TEXT NOT NULL, inbox TEXT NOT NULL, actor TEXT NOT NULL, UNIQUE (inbox, actor))",
"CREATE INDEX IF NOT EXISTS follows_actor ON follows (actor) INCLUDE (inbox)", "CREATE INDEX IF NOT EXISTS follows_actor ON follows (actor) INCLUDE (inbox)",
]; ];