Skip to content

Commit

Permalink
Txt sqlite db schema for dictionary
Browse files Browse the repository at this point in the history
This is the .schema of the [blank.sqlite
template](47492f8), extracted via
```
$ sqlite3 blank.sqlite '.schema' > blank.sqlite.schema
```

Just for reference: `push.sqlite`, `sbd.sqlite`, and `smd.sqlite`
currently have identical schemata.

Addresses #91
  • Loading branch information
iiegn committed May 2, 2019
1 parent 791a807 commit d53d7c6
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions website/dictTemplates/blank.sqlite.schema
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
CREATE TABLE configs (id TEXT PRIMARY KEY, json TEXT);
CREATE TABLE searchables (id INTEGER PRIMARY KEY AUTOINCREMENT, entry_id INTEGER REFERENCES entries (id) ON DELETE CASCADE, txt TEXT, level INTEGER);
CREATE INDEX search ON searchables (txt, level);
CREATE TABLE history (
id INTEGER PRIMARY KEY AUTOINCREMENT,
entry_id INTEGER,
[action] TEXT,
[when] DATETIME,
email TEXT,
xml TEXT,
historiography TEXT
);
CREATE INDEX history_by_entry_id ON history (
entry_id,
"when"
);
CREATE INDEX history_by_email ON history (
email,
"when"
);
CREATE INDEX history_by_when ON history (
"when"
);
CREATE INDEX history_by_action ON history (
"action",
"when"
);
CREATE TABLE sub (id INTEGER PRIMARY KEY AUTOINCREMENT, parent_id INTEGER REFERENCES entries (id) ON DELETE CASCADE, child_id INTEGER REFERENCES entries (id) ON DELETE CASCADE);
CREATE TABLE entries (id INTEGER PRIMARY KEY AUTOINCREMENT, doctype TEXT, xml TEXT, title TEXT, sortkey TEXT, needs_resave BOOLEAN DEFAULT (0), needs_refresh BOOLEAN DEFAULT (0), needs_refac BOOLEAN DEFAULT (0));
CREATE INDEX sortkey ON entries (sortkey);
CREATE INDEX needs_re ON entries (needs_resave, needs_refresh, needs_refac);

0 comments on commit d53d7c6

Please sign in to comment.