39 lines
988 B
SQL
39 lines
988 B
SQL
-- set some pragma
|
|
PRAGMA journal_mode = WAL;
|
|
PRAGMA busy_timeout = 15000; -- for interactive, 15s for background tasks
|
|
PRAGMA synchronous = NORMAL;
|
|
PRAGMA cache_size = 1000000000; -- means infinite
|
|
PRAGMA foreign_keys = true;
|
|
PRAGMA temp_store = memory;
|
|
|
|
CREATE TABLE instances (
|
|
-- PK will be rowid
|
|
domain TEXT UNIQUE
|
|
, name TEXT
|
|
, slogan TEXT
|
|
, description TEXT
|
|
, languages TEXT
|
|
, open INT -- BOOLEAN
|
|
, version TEXT
|
|
, location TEXT -- from IP
|
|
, failure INTEGER
|
|
, createdAt INTEGER -- second since epoch
|
|
, updatedAt INTEGER -- second since epoch
|
|
) strict;
|
|
|
|
create table stats (
|
|
insertedAt INTEGER
|
|
, instance_id INTEGER -- rowid of instance
|
|
, users INTEGER
|
|
, local_groups INTEGER
|
|
, total_groups INTEGER
|
|
, local_events INTEGER
|
|
, total_events INTEGER
|
|
, local_comments INTEGER
|
|
, total_comments INTEGER
|
|
, following INTEGER
|
|
, followers INTEGER
|
|
-- PK, would have been (instance_id, date)
|
|
-- to spare index, we declare no PK
|
|
) strict;
|