logotron_genesis.kv 1 drop table if exists loglines;
logotron_genesis.kv 2 create table loglines (
logotron_genesis.kv 3 ser serial,
logotron_genesis.kv 4 idx integer not null,
logotron_genesis.kv 5 t timestamp,
logotron_genesis.kv 6 chan text not null,
logotron_genesis.kv 7 era integer not null,
logotron_genesis.kv 8 speaker text not null,
logotron_genesis.kv 9 self boolean,
logotron_genesis.kv 10 payload text not null,
logotron_genesis.kv 11 backlinks integer[],
logotron_genesis.kv 12 PRIMARY KEY(idx, chan),
logotron_genesis.kv 13 UNIQUE(idx, chan)
logotron_genesis.kv 14 );
logotron_genesis.kv 15
logotron_genesis.kv 16
logotron_genesis.kv 17 create index logline_idx_i on loglines(idx);
logotron_genesis.kv 18 create index logline_t_i on loglines(t);
logotron_genesis.kv 19 create index logline_chan_i on loglines(chan);
logotron_genesis.kv 20 create index logline_era_i on loglines(era);
logotron_genesis.kv 21 create index logline_speaker_i on loglines(speaker);
logotron_genesis.kv 22 create index logline_payload_i on loglines(payload);
logotron_genesis.kv 23
logotron_genesis.kv 24 CREATE EXTENSION pg_trgm;
logotron_genesis.kv 25
logotron_genesis.kv 26 -- drop index payload_search_idx;
logotron_genesis.kv 27
logotron_genesis.kv 28 create index concurrently payload_search_idx
logotron_genesis.kv 29 ON loglines USING gin (payload gin_trgm_ops);