2020-10-28 20:49:11 +00:00
|
|
|
CREATE TABLE accounts (
|
2020-10-29 15:06:45 +00:00
|
|
|
id serial NOT NULL PRIMARY KEY,
|
|
|
|
|
|
|
|
acct VARCHAR(1000) NOT NULL UNIQUE,
|
2020-10-28 20:49:11 +00:00
|
|
|
avatar VARCHAR(2083) NOT NULL,
|
|
|
|
bot boolean,
|
2020-10-29 15:06:45 +00:00
|
|
|
created_at timestamptz DEFAULT NOW(),
|
|
|
|
display_name VARCHAR(2000) NOT NULL,
|
2020-10-28 20:49:11 +00:00
|
|
|
url VARCHAR(2083) NOT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE posts (
|
|
|
|
id serial NOT NULL PRIMARY KEY,
|
2020-10-29 15:06:45 +00:00
|
|
|
|
2020-10-28 20:49:11 +00:00
|
|
|
url VARCHAR(2083) NOT NULL,
|
|
|
|
content text,
|
|
|
|
created_at timestamptz DEFAULT NOW(),
|
|
|
|
|
2020-10-29 15:06:45 +00:00
|
|
|
normalized text,
|
2020-10-29 23:49:38 +00:00
|
|
|
account_id int NOT NULL REFERENCES accounts (id),
|
2020-11-24 00:00:04 -05:00
|
|
|
posthash bytea UNIQUE,
|
2020-11-28 11:42:31 -05:00
|
|
|
received_at timestamptz DEFAULT NOW()
|
2020-10-28 20:49:11 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
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)
|
|
|
|
);
|