1 -- Database should be in this folder, and named 'vchess.sqlite'
3 create table Variants (
4 id integer primary key,
11 id integer primary key,
22 create table Problems (
23 id integer primary key,
30 foreign key (uid
) references Users(id),
31 foreign key (vid
) references Variants(id)
35 id integer primary key,
39 foreign key (uid
) references Users(id)
42 create table Challenges (
43 id integer primary key,
51 foreign key (uid
) references Users(id),
52 foreign key (vid
) references Variants(id)
56 id integer primary key,
58 fenStart
varchar, --initial state
59 fen
varchar, --current state
62 score
varchar default '*',
65 randomness
integer, --for rematch
67 drawOffer
character default '',
68 rematchOffer
character default '',
69 deletedByWhite
boolean,
70 deletedByBlack
boolean,
71 foreign key (vid
) references Variants(id),
72 foreign key (white
) references Users(id),
73 foreign key (black
) references Users(id)
85 squares
varchar, --description, appear/vanish/from/to
86 played datetime
, --when was this move played?
87 idx
integer, --index of the move in the game
88 foreign key (gid
) references Games(id)
91 create index scoreIdx
on Games(score
);
93 pragma foreign_keys
= on;