2023-08-31 14:11:14 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS Profile {
|
|
|
|
id INT GENERATED ALWAYS AS IDENTITY,
|
|
|
|
first_seen_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
|
|
|
|
did TEXT UNIQUE,
|
2023-09-06 07:26:03 +01:00
|
|
|
has_been_processed BOOLEAN DEFAULT FALSE,
|
2023-08-31 14:11:14 +01:00
|
|
|
likely_country_of_living varchar(2) NULL DEFAULT NULL
|
|
|
|
}
|
|
|
|
|
2023-08-31 08:42:56 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS Post (
|
|
|
|
id INT GENERATED ALWAYS AS IDENTITY,
|
2023-08-31 14:11:14 +01:00
|
|
|
indexed_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
|
2023-08-31 08:42:56 +01:00
|
|
|
cid TEXT UNIQUE,
|
|
|
|
uri TEXT UNIQUE,
|
2023-08-31 14:11:14 +01:00
|
|
|
author_did TEXT REFERENCES Profile(did)
|
2023-08-31 08:42:56 +01:00
|
|
|
);
|
2023-09-21 11:33:17 +01:00
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS SubscriptionState (
|
|
|
|
id INT GENERATED ALWAYS AS IDENTITY,
|
|
|
|
service TEXT UNIQUE,
|
|
|
|
cursor INT
|
|
|
|
);
|