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,
21 create table Problems (
22 id integer primary key,
29 foreign key (uid
) references Users(id),
30 foreign key (vid
) references Variants(id)
34 id integer primary key,
38 foreign key (uid
) references Users(id)
41 create table Challenges (
42 id integer primary key,
50 foreign key (uid
) references Users(id),
51 foreign key (vid
) references Variants(id)
55 id integer primary key,
57 fenStart
varchar, --initial state
58 fen
varchar, --current state
59 score
varchar default '*',
62 randomness
integer, --for rematch
64 drawOffer
character default '',
65 rematchOffer
character default '',
66 deletedByWhite
boolean,
67 deletedByBlack
boolean,
68 foreign key (vid
) references Variants(id)
78 -- Store informations about players in a corr game
79 create table Players (
83 foreign key (gid
) references Games(id),
84 foreign key (uid
) references Users(id)
89 squares
varchar, --description, appear/vanish/from/to
90 played datetime
, --when was this move played?
91 idx
integer, --index of the move in the game
92 foreign key (gid
) references Games(id)
95 pragma foreign_keys
= on;