From 95231cf6650d277fc13f5c0e1c1a0e1bb9c30edb Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Sat, 4 Feb 2012 11:16:42 -0800 Subject: fixed showing re/contra call at beginning of game; allowed pre-game comments; DB upgrade the problem with re/contra at the beginning of a game was that no playid was set yet, so we couldn't record when the call was made. Added two special playid (-1 and -2), for pre-game comments and re/contra calls before the first card is played. For this we need to record the gameid in the comment table => DB update --- update_db.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'update_db.php') diff --git a/update_db.php b/update_db.php index 498b24e..c40f89a 100644 --- a/update_db.php +++ b/update_db.php @@ -37,7 +37,7 @@ if(isset($_SERVER['REMOTE_ADDR'])) exit(); $old_version = DB_get_version(); -$current_version = 2; +$current_version = 3; if($old_version < $current_version) echo "Will upgrade your database now:\n"; @@ -68,6 +68,12 @@ switch($old_version) DB_query("UPDATE Version set version=2"); echo "Upgraded to version 2.\n"; + case 2: + DB_query("ALTER TABLE Comment". + " ADD COLUMN `game_id` int(11) default NULL AFTER play_id"); + DB_query("UPDATE Version set version=3"); + echo "Upgraded to version 3.\n"; + } ?> \ No newline at end of file -- cgit v1.2.3-18-g5258