fedilogue/poll/tables.sql
Farhan Khan 58d63dea93 added web receiving scaffolding
changed pprof port to 7777
added received_at post column
2020-11-24 00:00:04 -05:00

35 lines
741 B
SQL

CREATE TABLE accounts (
id serial NOT NULL PRIMARY KEY,
acct VARCHAR(1000) NOT NULL UNIQUE,
avatar VARCHAR(2083) NOT NULL,
bot boolean,
created_at timestamptz DEFAULT NOW(),
display_name VARCHAR(2000) NOT NULL,
url VARCHAR(2083) NOT NULL
);
CREATE TABLE posts (
id serial NOT NULL PRIMARY KEY,
url VARCHAR(2083) NOT NULL,
content text,
created_at timestamptz DEFAULT NOW(),
normalized text,
account_id int NOT NULL REFERENCES accounts (id),
posthash bytea UNIQUE,
received_at timestamptz DEFAULT NOW(),
);
CREATE TABLE instances (
id serial NOT NULL PRIMARY KEY,
endpoint VARCHAR(2083) NOT NULL,
autostart boolean,
state varchar(16),
username varchar(32),
password varchar(32),
software varchar(50)
);