xref: /plugin/struct/db/update0001.sql (revision 083afc55c907a52e46afc662d6f808a98112c779)
1-- Defines the schema of one class of data
2CREATE TABLE schemas (
3    id INT PRIMARY KEY NOT NULL,
4    tbl NOT NULL,
5    ts INT NOT NULL,
6    chksum DEFAULT ''
7);
8
9-- Stores the configured type of a single column in a schema
10CREATE TABLE types (
11    id INT PRIMARY KEY NOT NULL,
12    class NOT NULL,
13    multi BOOLEAN DEFAULT 0,
14    label DEFAULT '',
15    config DEFAULT ''
16);
17
18-- Store what columns of which type are there in a schema
19CREATE TABLE schema_cols (
20    schema_id REFERENCES schema (id),
21    col NOT NULL,
22    type_id REFERENCES type (id),
23    sort INT NOT NULL,
24    PRIMARY KEY ( schema_id, col)
25);
26