projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
TODO: finish draw offer logic + fix inCheck bug (no highlight)
[vchess.git]
/
server
/
db
/
create.sql
diff --git
a/server/db/create.sql
b/server/db/create.sql
index
0251c17
..
21c7728
100644
(file)
--- a/
server/db/create.sql
+++ b/
server/db/create.sql
@@
-13,21
+13,10
@@
create table Users (
loginToken varchar,
loginTime datetime,
sessionToken varchar,
loginToken varchar,
loginTime datetime,
sessionToken varchar,
+ created datetime,
notify boolean
);
notify boolean
);
-create table Problems (
- id integer primary key,
- added datetime,
- uid integer,
- vid integer,
- fen varchar,
- instructions text,
- solution text,
- foreign key (uid) references Users(id),
- foreign key (vid) references Variants(id)
-);
-
-- All the following tables are for correspondance play only
-- (Live games are stored in browser)
-- All the following tables are for correspondance play only
-- (Live games are stored in browser)
@@
-43,17
+32,26
@@
create table Challenges (
foreign key (vid) references Variants(id)
);
foreign key (vid) references Variants(id)
);
--- NOTE: no need for a "created" field, it's deduced from first move playing time
create table Games (
id integer primary key,
vid integer,
fenStart varchar, --initial state
fen varchar, --current state
score varchar,
create table Games (
id integer primary key,
vid integer,
fenStart varchar, --initial state
fen varchar, --current state
score varchar,
+ scoreMsg varchar,
timeControl varchar,
timeControl varchar,
+ created datetime, --used only for DB cleaning
+ drawOffer character,
foreign key (vid) references Variants(id)
);
foreign key (vid) references Variants(id)
);
+create table Chats (
+ gid integer,
+ name varchar,
+ msg varchar,
+ added datetime
+);
+
-- Store informations about players in a corr game
create table Players (
gid integer,
-- Store informations about players in a corr game
create table Players (
gid integer,
@@
-66,10
+64,8
@@
create table Players (
create table Moves (
gid integer,
squares varchar, --description, appear/vanish/from/to
create table Moves (
gid integer,
squares varchar, --description, appear/vanish/from/to
- message varchar,
played datetime, --when was this move played?
idx integer, --index of the move in the game
played datetime, --when was this move played?
idx integer, --index of the move in the game
- color character, --required for e.g. Marseillais Chess
foreign key (gid) references Games(id)
);
foreign key (gid) references Games(id)
);