33 lines
694 B
MySQL
33 lines
694 B
MySQL
|
CREATE TABLE accounts (
|
||
|
id serial NOT NULL PRIMARY KEY,
|
||
|
acct VARCHAR(100) NOT NULL UNIQUE,
|
||
|
avatar VARCHAR(2083) NOT NULL,
|
||
|
bot boolean,
|
||
|
created_at VARCHAR(100) NOT NULL,
|
||
|
display_name VARCHAR(100) NOT NULL,
|
||
|
url VARCHAR(2083) NOT NULL
|
||
|
);
|
||
|
|
||
|
CREATE TABLE posts (
|
||
|
id serial NOT NULL PRIMARY KEY,
|
||
|
url VARCHAR(2083) NOT NULL,
|
||
|
content text,
|
||
|
strippedcontent text,
|
||
|
created_at timestamptz DEFAULT NOW(),
|
||
|
|
||
|
acct_id int NOT NULL REFERENCES accounts (id),
|
||
|
|
||
|
posthash bytea UNIQUE
|
||
|
);
|
||
|
|
||
|
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)
|
||
|
);
|