From 6206ef89ad9a9a1a541ecb67971815d11f12199b Mon Sep 17 00:00:00 2001
From: Arun Persaud <arun@nubati.net>
Date: Mon, 16 Mar 2009 22:06:21 -0700
Subject: BUGFIX: store canceled games, don't delete them

deleting the games could result in the same people getting the same hand redealt over and over again.
By just keeping track of the hands in the game table, this problem should be gone.

Fixed issue #50.
---
 create_database.sql | 30 ++++++++++++++++++++++++++----
 1 file changed, 26 insertions(+), 4 deletions(-)

(limited to 'create_database.sql')

diff --git a/create_database.sql b/create_database.sql
index 47d1b55..319cdd3 100644
--- a/create_database.sql
+++ b/create_database.sql
@@ -12,6 +12,28 @@
 /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
 /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
 
+
+--
+-- Table structure for table `Version`
+--
+
+DROP TABLE IF EXISTS `Version`;
+CREATE TABLE `Version` (
+  `version` int NOT NULL default '0'
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `Card`
+--
+
+
+/*!40000 ALTER TABLE `Card` DISABLE KEYS */;
+LOCK TABLES `Version` WRITE;
+INSERT INTO `Version` VALUES (1);
+UNLOCK TABLES;
+/*!40000 ALTER TABLE `Version` ENABLE KEYS */;
+
+
 --
 -- Table structure for table `Card`
 --
@@ -98,9 +120,9 @@ CREATE TABLE `Game` (
   `type` enum('normal','solo','wedding','poverty','dpoverty') default NULL,
   `solo` enum('trumpless','jack','queen','trump','club','spade','heart','silent') default NULL,
   `sickness` int(11) default NULL,
-  `startplayer` tinyint(4) default '1', 
-  `player` int(11) default NULL, 
-  `status` enum('pre','play','gameover') default NULL,
+  `startplayer` tinyint(4) default '1',
+  `player` int(11) default NULL,
+  `status` enum('pre','play','gameover','cancel-timedout','cancel-nines','cancel-trump','cancel-noplay') default NULL,
   `ruleset` int(11) default NULL,
   `session` int(11) default NULL,
   `id` int(11) NOT NULL auto_increment,
@@ -133,7 +155,7 @@ CREATE TABLE `Rulesets` (
   `id` int(11) NOT NULL auto_increment,
   UNIQUE KEY `id` (`id`)
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-  
+
 --
 -- Dumping data for table `Rulesets`
 --
-- 
cgit v1.2.3-18-g5258

