0fb74564bee402f0407d6e6af1c73ed75047be65
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 in browser)
34 create table Challenges (
35 id integer primary key,
42 foreign key (uid
) references Users(id),
43 foreign key (vid
) references Variants(id)
46 -- NOTE: no need for a "created" field, it's deduce from first move playing time
48 id integer primary key,
50 fenStart
varchar, --initial state
51 fen
varchar, --current state
54 foreign key (vid
) references Variants(id)
57 -- Store informations about players in a corr game
58 create table Players (
62 rtime
integer, --remaining time in milliseconds
63 foreign key (gid
) references Games(id),
64 foreign key (uid
) references Users(id)
71 played datetime
, --when was this move played?
72 idx
integer, --index of the move in the game
73 color
character, --required for e.g. Marseillais Chess
74 foreign key (gid
) references Games(id)
77 pragma foreign_keys
= on;