projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Complete translations of Empire Chess rules
[vchess.git]
/
server
/
db
/
create.sql
diff --git
a/server/db/create.sql
b/server/db/create.sql
index
c9f5232
..
15417b1
100644
(file)
--- a/
server/db/create.sql
+++ b/
server/db/create.sql
@@
-3,7
+3,8
@@
create table Variants (
id integer primary key,
name varchar unique,
create table Variants (
id integer primary key,
name varchar unique,
- description text
+ description text,
+ noProblems boolean
);
create table Users (
);
create table Users (
@@
-14,7
+15,8
@@
create table Users (
loginTime datetime,
sessionToken varchar,
created datetime,
loginTime datetime,
sessionToken varchar,
created datetime,
- notify boolean
+ notify boolean,
+ bio text default ''
);
create table Problems (
);
create table Problems (
@@
-29,14
+31,6
@@
create table Problems (
foreign key (vid) references Variants(id)
);
foreign key (vid) references Variants(id)
);
-create table News (
- id integer primary key,
- uid integer,
- added datetime,
- content text,
- foreign key (uid) references Users(id)
-);
-
create table Challenges (
id integer primary key,
added datetime,
create table Challenges (
id integer primary key,
added datetime,
@@
-55,15
+49,22
@@
create table Games (
vid integer,
fenStart varchar, --initial state
fen varchar, --current state
vid integer,
fenStart varchar, --initial state
fen varchar, --current state
+ white integer,
+ black integer,
score varchar default '*',
scoreMsg varchar,
cadence varchar,
score varchar default '*',
scoreMsg varchar,
cadence varchar,
+ randomness integer, --for rematch
created datetime,
drawOffer character default '',
rematchOffer character default '',
deletedByWhite boolean,
deletedByBlack boolean,
created datetime,
drawOffer character default '',
rematchOffer character default '',
deletedByWhite boolean,
deletedByBlack boolean,
- foreign key (vid) references Variants(id)
+ chatReadWhite datetime,
+ chatReadBlack datetime,
+ foreign key (vid) references Variants(id),
+ foreign key (white) references Users(id),
+ foreign key (black) references Users(id)
);
create table Chats (
);
create table Chats (
@@
-73,15
+74,6
@@
create table Chats (
added datetime
);
added datetime
);
--- Store informations about players in a corr game
-create table Players (
- gid integer,
- uid integer,
- color character,
- foreign key (gid) references Games(id),
- foreign key (uid) references Users(id)
-);
-
create table Moves (
gid integer,
squares varchar, --description, appear/vanish/from/to
create table Moves (
gid integer,
squares varchar, --description, appear/vanish/from/to
@@
-90,4
+82,6
@@
create table Moves (
foreign key (gid) references Games(id)
);
foreign key (gid) references Games(id)
);
+create index scoreIdx on Games(score);
+
pragma foreign_keys = on;
pragma foreign_keys = on;