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,
19 create table Problems (
20 id integer primary key,
27 foreign key (uid
) references Users(id),
28 foreign key (vid
) references Variants(id)
31 -- All the following tables are for correspondance play only
32 -- (Live games are stored only in browsers)
34 create table Challenges (
35 id integer primary key,
43 foreign key (uid
) references Users(id),
44 foreign key (vid
) references Variants(id)
47 -- Store informations about players who accept a challenge
48 create table WillPlay (
51 foreign key (cid
) references Challenges(id),
52 foreign key (uid
) references Users(id)
56 id integer primary key,
58 fenStart
varchar, --initial state
59 fen
varchar, --current state
63 foreign key (vid
) references Variants(id)
66 -- Store informations about players in a corr game
67 create table Players (
71 rtime
integer, --remaining time in milliseconds
72 foreign key (gid
) references Games(id),
73 foreign key (uid
) references Users(id)
80 played datetime
, --when was this move played?
81 idx
integer, --index of the move in the game
82 color
character, --required for e.g. Marseillais Chess
83 foreign key (gid
) references Games(id)
86 pragma foreign_keys
= on;