· 8 years ago · Jan 13, 2018, 09:32 PM
1CREATE TABLE IF NOT EXISTS `deals` (
2 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
3 `created` datetime NOT NULL,
4 `modified` datetime NOT NULL,
5 `user_id` bigint(20) NOT NULL,
6 `name` varchar(250) COLLATE utf8_unicode_ci NOT NULL,
7 `slug` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
8 `bitly_short_url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
9 `description` text COLLATE utf8_unicode_ci NOT NULL,
10 `private_note` text COLLATE utf8_unicode_ci,
11 `original_price` double(10,2) NOT NULL,
12 `discounted_price` double(10,2) DEFAULT '0.00',
13 `is_anytime_deal` tinyint(1) NOT NULL DEFAULT '0',
14 `start_date` datetime NOT NULL,
15 `end_date` datetime DEFAULT NULL,
16 `discount_percentage` double(10,2) unsigned DEFAULT '0.00',
17 `discount_amount` double(10,2) DEFAULT '0.00',
18 `savings` double(10,2) DEFAULT '0.00',
19 `min_limit` int(11) unsigned NOT NULL,
20 `max_limit` int(11) unsigned DEFAULT NULL,
21 `city_id` bigint(20) unsigned NOT NULL,
22 `company_id` bigint(20) unsigned NOT NULL,
23 `review` text COLLATE utf8_unicode_ci NOT NULL,
24 `deal_user_count` bigint(20) unsigned NOT NULL,
25 `payment_failed_count` bigint(20) DEFAULT '0',
26 `buy_min_quantity_per_user` int(11) DEFAULT '1',
27 `buy_max_quantity_per_user` int(11) DEFAULT '0',
28 `deal_tipped_time` datetime NOT NULL,
29 `coupon_start_date` datetime NOT NULL,
30 `coupon_expiry_date` datetime DEFAULT NULL,
31 `coupon_condition` text COLLATE utf8_unicode_ci NOT NULL,
32 `coupon_highlights` text COLLATE utf8_unicode_ci NOT NULL,
33 `comment` text COLLATE utf8_unicode_ci NOT NULL,
34 `is_coupon_mail_sent` tinyint(1) unsigned NOT NULL,
35 `is_subscription_mail_sent` tinyint(1) NOT NULL DEFAULT '0',
36 `is_side_deal` tinyint(1) DEFAULT '0',
37 `deal_status_id` int(2) unsigned NOT NULL,
38 `bonus_amount` double(10,2) DEFAULT '0.00',
39 `commission_percentage` double(10,2) DEFAULT '0.00',
40 `total_commission_amount` double(10,2) DEFAULT '0.00',
41 `total_purchased_amount` double(10,2) DEFAULT '0.00',
42 `net_profit` double(10,2) DEFAULT '0.00',
43 `meta_keywords` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
44 `meta_description` text COLLATE utf8_unicode_ci,
45 `bitly_short_url_subdomain` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
46 `bitly_short_url_prefix` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
47 `shiping_cost` decimal(10,2) NOT NULL,
48 PRIMARY KEY (`id`),
49 KEY `city_id` (`city_id`),
50 KEY `slug` (`slug`),
51 KEY `company_id` (`company_id`),
52 KEY `deal_status_id` (`deal_status_id`),
53 KEY `user_id` (`user_id`)
54) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=978 ;