2021-01-05 05:54:27 +00:00
|
|
|
DROP TABLE IF EXISTS instances;
|
|
|
|
DROP TABLE IF EXISTS posts;
|
|
|
|
DROP TABLE IF EXISTS accounts;
|
2020-10-29 15:06:45 +00:00
|
|
|
|
2020-12-22 20:20:12 +00:00
|
|
|
CREATE TABLE accounts (
|
2021-01-05 05:54:27 +00:00
|
|
|
actor_type VARCHAR(1000) NOT NULL,
|
2021-01-06 02:43:41 +00:00
|
|
|
id VARCHAR(2083) NOT NULL PRIMARY KEY UNIQUE,
|
2021-01-05 05:54:27 +00:00
|
|
|
inbox VARCHAR(2083) NOT NULL,
|
|
|
|
outbox VARCHAR(2083) NOT NULL,
|
|
|
|
followers VARCHAR(2083) NOT NULL,
|
|
|
|
following VARCHAR(2083) NOT NULL,
|
|
|
|
url VARCHAR(2083) NOT NULL,
|
|
|
|
preferredusername VARCHAR(1000) NOT NULL,
|
|
|
|
name VARCHAR(1000) NOT NULL,
|
|
|
|
summary TEXT,
|
|
|
|
icon VARCHAR(2083),
|
|
|
|
image VARCHAR(2083),
|
|
|
|
publickey TEXT,
|
|
|
|
identifiedat TIMESTAMP with time zone DEFAULT now(),
|
|
|
|
instance VARCHAR(1000) NOT NULL
|
2020-10-28 20:49:11 +00:00
|
|
|
);
|
|
|
|
|
2020-12-22 20:20:12 +00:00
|
|
|
CREATE TABLE posts (
|
2021-01-06 02:43:41 +00:00
|
|
|
id VARCHAR(2083) NOT NULL PRIMARY KEY UNIQUE,
|
2021-01-05 05:54:27 +00:00
|
|
|
inreplyto VARCHAR(2083),
|
|
|
|
published TIMESTAMP with time zone NOT NULL,
|
|
|
|
summary TEXT,
|
|
|
|
content TEXT,
|
|
|
|
normalized TEXT,
|
|
|
|
attributedto VARCHAR(2083) REFERENCES accounts,
|
2020-12-22 20:20:12 +00:00
|
|
|
posthash bytea,
|
2021-01-05 05:54:27 +00:00
|
|
|
received_at TIMESTAMP with time zone DEFAULT now(),
|
|
|
|
instance VARCHAR(1000) NOT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE instances (
|
2021-01-06 02:43:41 +00:00
|
|
|
endpoint VARCHAR(2083) NOT NULL PRIMARY KEY UNIQUE,
|
2021-01-05 05:54:27 +00:00
|
|
|
autostart BOOLEAN,
|
|
|
|
state VARCHAR(16),
|
|
|
|
username VARCHAR(32),
|
|
|
|
password VARCHAR(32),
|
|
|
|
software VARCHAR(50)
|
2020-10-28 20:49:11 +00:00
|
|
|
);
|