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,
39 foreign key (uid
) references Users(id),
40 foreign key (vid
) references Variants(id)
43 -- Store informations about players who accept a challenge
44 create table WillPlay (
48 foreign key (cid
) references Challenges(id),
49 foreign key (uid
) references Users(id)
53 id integer primary key,
55 fen
varchar, --initial position
57 foreign key (vid
) references Variants(id)
60 -- Store informations about players in a corr game
61 create table Players (
65 foreign key (uid
) references Users(id),
66 foreign key (gid
) references Games(id)
72 played datetime
, --when was this move played?
73 idx
integer, --index of the move in the game
74 color
character, --required for e.g. Marseillais Chess
75 foreign key (gid
) references Games(id)
78 pragma foreign_keys
= on;