PluginProbe
MakeCommerce for WooCommerce / 3.0.2
MakeCommerce for WooCommerce v3.0.2
4.1.0 4.0.8 trunk 1.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 2.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.2.0 2.2.1 2.2.2 All 96 releases
← All changes | includes/activator.php +19 -13 trunk3.0.2 View file →
@@ -23,18 +23,8 @@
23 23 * @since 3.0.0
24 24 */
25 25 public static function activate() {
26 26
27 - self::create_tables();
28 -
29 - }
30 -
31 - /**
32 - * Creates db tables.
33 - *
34 - * @since 3.0.12
35 - */
36 - public static function create_tables() {
37 27 global $wpdb;
38 28
39 29 //Create table if it doesn't already exist
40 30 $wpdb->query
@@ -47,16 +37,32 @@
47 37 `country` char(2) NOT NULL,
48 38 `name` varchar(25) NOT NULL,
49 39 `url` varchar(250) NOT NULL,
50 40 `logo_url` varchar(250),
51 - `channel` varchar(250),
52 - `display_name` varchar(250),
53 41 `min_amount` mediumint(9),
54 42 `max_amount` mediumint(9),
55 - PRIMARY KEY `id` (`id`)
43 + UNIQUE KEY `id` (`id`)
56 44 )
57 45 " . $wpdb->get_charset_collate() . ";
58 46 ");
59 47
48 + //Create sco table if it doesn't already exist
49 + $wpdb->query
50 + ("
51 + CREATE TABLE IF NOT EXISTS
52 + `" . $wpdb->prefix . MAKECOMMERCE_SCO_TABLENAME . "`
53 + (
54 + `id` int(11) unsigned not null auto_increment,
55 + `cart_id` varchar(64) not null default '',
56 + `order_id` int(10) unsigned not null,
57 + `created` int(10) unsigned not null,
58 + `modified` int(10) unsigned not null,
59 + `status` tinyint unsigned not null,
60 + `content` mediumtext,
61 + unique key id (`id`),
62 + key `cart_id` (`cart_id`)
63 + )
64 + " . $wpdb->get_charset_collate() . ";
65 + ");
60 66 }
61 67
62 68 }