woocommerce / woocommerce-product-tables-feature-plugin

Implements new data-stores and moves product data into custom tables, with a new, normalised data structure.
GNU General Public License v3.0
192 stars 32 forks source link

Tables not created #113

Closed benfavre closed 6 years ago

benfavre commented 6 years ago

image image

benfavre commented 6 years ago

image

benfavre commented 6 years ago

"virtual" is a reserved word.

VIRTUAL (R) added in 5.7.6 (reserved)

benfavre commented 6 years ago
$tables = "
            CREATE TABLE {$wpdb->prefix}wc_products (
              `product_id` bigint(20) NOT NULL,
              `sku` varchar(100) NULL default '',
              `image_id` bigint(20) NULL default 0,
              `height` double NULL default NULL,
              `width` double NULL default NULL,
              `length` double NULL default NULL,
              `weight` double NULL default NULL,
              `stock_quantity` double NULL default NULL,
              `type` varchar(100) NULL default 'simple',
              `virtual` tinyint(1) NULL default 0,
              `downloadable` tinyint(1) NULL default 0,
              `tax_class` varchar(100) NULL default '',
              `tax_status` varchar(100) NULL default 'taxable',
              `total_sales` double NULL default 0,
              `price` double NULL default NULL,
              `regular_price` double NULL default NULL,
              `sale_price` double NULL default NULL,
              `date_on_sale_from` datetime NULL default NULL,
              `date_on_sale_to` datetime NULL default NULL,
              `average_rating` float NULL default 0,
              `stock_status` varchar(100) NULL default 'instock',
              PRIMARY KEY  (`product_id`),
              KEY image_id (image_id),
              KEY type (type),
              KEY is_virtual (is_virtual),
              KEY downloadable (downloadable),
              KEY stock_status (stock_status)

            ) $collate;