DROP TABLE IF EXISTS Train;
DROP TABLE IF EXISTS Test;

CREATE TABLE train (
    id    INTEGER PRIMARY KEY ASC AUTOINCREMENT
                  UNIQUE
                  NOT NULL,
    fen   TEXT    UNIQUE
                  NOT NULL,
    cpe   INTEGER NOT NULL,
    dep INTEGER NOT NULL,
    nxt   TEXT,
    mate  INTEGER,
    flag  INTEGER NOT NULL
                  DEFAULT (0),
    ver   INTEGER NOT NULL
                  DEFAULT (1) 
);

CREATE TABLE test (
    id    INTEGER PRIMARY KEY ASC AUTOINCREMENT
                  UNIQUE
                  NOT NULL,
    fen   TEXT    UNIQUE
                  NOT NULL,
    cpe   INTEGER NOT NULL,
    dep INTEGER NOT NULL,
    nxt   TEXT,
    mate  INTEGER,
    flag  INTEGER NOT NULL
                  DEFAULT (0),
    ver   INTEGER NOT NULL
                  DEFAULT (1) 
);
