File size: 1.56Kb
+-------------+-----------------------------------------------------------------------------+------+-----+---------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-----------------------------------------------------------------------------+------+-----+---------------------+----------------+
| gameID | smallint(6) | | PRI | NULL | auto_increment |
| whitePlayer | mediumint(9) | | | 0 | |
| blackPlayer | mediumint(9) | | | 0 | |
| gameMessage | enum('playerInvited','inviteDeclined','draw','playerResigned','checkMate') | YES | | NULL | || messageFrom | enum('black','white') | YES | | NULL | |
| dateCreated | datetime | | | 0000-00-00 00:00:00 | |
| lastMove | datetime | | | 0000-00-00 00:00:00 | |
+-------------+-----------------------------------------------------------------------------+------+-----+---------------------+----------------+
CREATE TABLE games (
gameID SMALLINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
whitePlayer MEDIUMINT NOT NULL,
blackPlayer MEDIUMINT NOT NULL,
gameMessage ENUM('playerInvited', 'inviteDeclined', 'draw', 'playerResigned', 'checkMate') NULL,
messageFrom ENUM('black', 'white') NULL,
dateCreated DATETIME NOT NULL,
lastMove DATETIME NOT NULL
);