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
61 score
varchar default '*',
64 randomness
integer, --for rematch
66 drawOffer
character default '',
67 rematchOffer
character default '',
68 deletedByWhite
boolean,
69 deletedByBlack
boolean,
70 foreign key (vid
) references Variants(id),
71 foreign key (white
) references Users(id),
72 foreign key (black
) references Users(id)
84 squares
varchar, --description, appear/vanish/from/to
85 played datetime
, --when was this move played?
86 idx
integer, --index of the move in the game
87 foreign key (gid
) references Games(id)
90 create index scoreIdx
on Games(score
);
92 pragma foreign_keys
= on;