projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
A few small fixes + add Monster variant
[vchess.git]
/
server
/
db
/
create.sql
diff --git
a/server/db/create.sql
b/server/db/create.sql
index
5aba8ff
..
7c361b4
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 (
@@
-56,6
+57,8
@@
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,
@@
-65,7
+68,9
@@
create table Games (
rematchOffer character default '',
deletedByWhite boolean,
deletedByBlack boolean,
rematchOffer character default '',
deletedByWhite boolean,
deletedByBlack boolean,
- foreign key (vid) references Variants(id)
+ foreign key (vid) references Variants(id),
+ foreign key (white) references Users(id),
+ foreign key (black) references Users(id)
);
create table Chats (
);
create table Chats (
@@
-75,15
+80,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
@@
-92,4
+88,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;