diff --git a/path_10_9/data/migrations/22.lua b/path_10_9/data/migrations/22.lua index bfbd3e2fb..4ff723e1a 100644 --- a/path_10_9/data/migrations/22.lua +++ b/path_10_9/data/migrations/22.lua @@ -1,5 +1,5 @@ function onUpdateDatabase() print("> Updating database to version 22 (Reward System)") - db.query([[CREATE TABLE `player_rewards` ( `player_id` int(11) NOT NULL, `sid` int(11) NOT NULL, `pid` int(11) NOT NULL DEFAULT '0', `itemtype` smallint(6) NOT NULL, `count` smallint(5) NOT NULL DEFAULT '0', `attributes` blob NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1;]]) + db.query([[CREATE TABLE IF NOT EXISTS `player_rewards` ( `player_id` int(11) NOT NULL, `sid` int(11) NOT NULL, `pid` int(11) NOT NULL DEFAULT '0', `itemtype` smallint(6) NOT NULL, `count` smallint(5) NOT NULL DEFAULT '0', `attributes` blob NOT NULL, UNIQUE KEY `player_id_2` (`player_id`, `sid`), FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE ) ENGINE=InnoDB;]]) return true end