1 -- Database should be in this folder, and named 'vchess.sqlite'
3 create table Variants (
4 id integer primary key,
10 id integer primary key,
20 -- All the following tables are for correspondance play only
21 -- (Live games are stored in browser)
23 create table Challenges (
24 id integer primary key,
31 foreign key (uid
) references Users(id),
32 foreign key (vid
) references Variants(id)
35 -- NOTE: no need for a "created" field, it's deduced from first move playing time
37 id integer primary key,
39 fenStart
varchar, --initial state
40 fen
varchar, --current state
43 created datetime
, --used only for DB cleaning
45 foreign key (vid
) references Variants(id)
48 -- Store informations about players in a corr game
49 create table Players (
53 foreign key (gid
) references Games(id),
54 foreign key (uid
) references Users(id)
59 squares
varchar, --description, appear/vanish/from/to
61 played datetime
, --when was this move played?
62 idx
integer, --index of the move in the game
63 foreign key (gid
) references Games(id)
66 pragma foreign_keys
= on;