sphinx-relay/testing/cluster.sql

108 lines
2.1 KiB
MySQL
Raw Permalink Normal View History

2021-05-04 12:50:29 -05:00
CREATE TABLE media (
id TEXT NOT NULL PRIMARY KEY,
owner_pub_key TEXT NOT NULL,
name TEXT,
description TEXT,
price BIGINT,
tags TEXT[] not null default '{}',
ttl BIGINT,
filename TEXT,
size BIGINT,
mime TEXT,
nonce TEXT,
created timestamptz,
updated timestamptz,
expiry timestamptz, -- optional permanent deletion of file
total_sats BIGINT,
total_buys BIGINT,
template boolean,
width INT,
height INT
);
ALTER TABLE media ADD COLUMN tsv tsvector;
CREATE INDEX media_tsv ON media USING GIN(tsv);
CREATE TABLE tribes (
uuid TEXT NOT NULL PRIMARY KEY,
owner_pub_key TEXT NOT NULL,
owner_alias TEXT,
group_key TEXT,
name TEXT,
description TEXT,
tags TEXT[] not null default '{}',
img TEXT,
price_to_join BIGINT,
price_per_message BIGINT,
escrow_amount BIGINT,
escrow_millis BIGINT,
created timestamptz,
updated timestamptz,
member_count BIGINT,
unlisted boolean,
private boolean,
deleted boolean,
app_url TEXT,
2021-05-21 12:13:37 -07:00
feed_url TEXT,
last_active BIGINT,
2021-05-04 12:50:29 -05:00
bots TEXT,
owner_route_hint TEXT,
unique_name TEXT
);
ALTER TABLE tribes ADD COLUMN tsv tsvector;
CREATE INDEX tribes_tsv ON tribes USING GIN(tsv);
CREATE TABLE bots (
uuid TEXT NOT NULL PRIMARY KEY,
owner_pub_key TEXT NOT NULL,
owner_alias TEXT,
name TEXT,
unique_name TEXT,
description TEXT,
tags TEXT[] not null default '{}',
img TEXT,
price_per_use BIGINT,
created timestamptz,
updated timestamptz,
member_count BIGINT,
unlisted boolean,
deleted boolean,
owner_route_hint TEXT
2021-05-04 12:50:29 -05:00
);
ALTER TABLE bots ADD COLUMN tsv tsvector;
CREATE INDEX bots_tsv ON bots USING GIN(tsv);
2021-05-18 18:51:06 -07:00
CREATE TABLE people (
id SERIAL PRIMARY KEY,
owner_pub_key TEXT NOT NULL,
owner_alias TEXT,
owner_route_hint TEXT,
2021-05-21 10:24:07 -07:00
owner_contact_key TEXT,
2021-05-18 18:51:06 -07:00
description TEXT,
tags TEXT[] not null default '{}',
img TEXT,
created timestamptz,
updated timestamptz,
unlisted boolean,
deleted boolean,
unique_name TEXT,
price_to_meet BIGINT,
twitter TEXT
2021-05-18 18:51:06 -07:00
);
ALTER TABLE people ADD COLUMN tsv tsvector;
CREATE INDEX people_tsv ON people USING GIN(tsv);