· 9 years ago · Dec 24, 2016, 07:28 PM
1DROP TABLE IF EXISTS `bichbets`;
2CREATE TABLE `bichbets` (
3 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
4 `user_id` int(10) unsigned DEFAULT NULL,
5 `game_id` int(10) unsigned DEFAULT NULL,
6 `bichgame_id` int(10) unsigned DEFAULT NULL,
7 `place` int(32) NOT NULL DEFAULT '0',
8 `items` text COLLATE utf8_unicode_ci NOT NULL,
9 `itemsCount` int(11) NOT NULL,
10 `price` double(8,2) NOT NULL,
11 `from` int(11) NOT NULL,
12 `to` int(11) NOT NULL,
13 `created_at` timestamp NOT NULL DEFAULT '1999-01-01 00:00:00',
14 `updated_at` timestamp NOT NULL DEFAULT '1999-01-01 00:00:00',
15 PRIMARY KEY (`id`),
16 KEY `bichbets_user_id_foreign` (`user_id`),
17 KEY `bichbets_game_id_foreign` (`game_id`),
18 CONSTRAINT `bichbets_game_id_foreign` FOREIGN KEY (`game_id`) REFERENCES `bichgames` (`id`) ON DELETE CASCADE,
19 CONSTRAINT `bichbets_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
20) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;