Add table schema

This commit is contained in:
Mike Jolley 2020-02-19 12:15:54 +00:00
parent c983677a6f
commit 62e099bd84
2 changed files with 10 additions and 0 deletions

View File

@ -946,6 +946,14 @@ CREATE TABLE {$wpdb->prefix}wc_tax_rate_classes (
slug varchar(200) NOT NULL DEFAULT '', slug varchar(200) NOT NULL DEFAULT '',
PRIMARY KEY (tax_rate_class_id), PRIMARY KEY (tax_rate_class_id),
UNIQUE KEY slug (slug($max_index_length)) UNIQUE KEY slug (slug($max_index_length))
) $collate;
CREATE TABLE {$wpdb->prefix}wc_reserved_stock (
`order_id` bigint(20) NOT NULL,
`product_id` bigint(20) NOT NULL,
`stock_quantity` double NOT NULL DEFAULT 0,
`timestamp` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`expires` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`order_id`, `product_id`)
) $collate; ) $collate;
"; ";
@ -980,6 +988,7 @@ CREATE TABLE {$wpdb->prefix}wc_tax_rate_classes (
"{$wpdb->prefix}woocommerce_shipping_zones", "{$wpdb->prefix}woocommerce_shipping_zones",
"{$wpdb->prefix}woocommerce_tax_rate_locations", "{$wpdb->prefix}woocommerce_tax_rate_locations",
"{$wpdb->prefix}woocommerce_tax_rates", "{$wpdb->prefix}woocommerce_tax_rates",
"{$wpdb->prefix}wc_reserved_stock",
); );
/** /**

View File

@ -246,6 +246,7 @@ final class WooCommerce {
'order_itemmeta' => 'woocommerce_order_itemmeta', 'order_itemmeta' => 'woocommerce_order_itemmeta',
'wc_product_meta_lookup' => 'wc_product_meta_lookup', 'wc_product_meta_lookup' => 'wc_product_meta_lookup',
'wc_tax_rate_classes' => 'wc_tax_rate_classes', 'wc_tax_rate_classes' => 'wc_tax_rate_classes',
'wc_reserved_stock' => 'wc_reserved_stock',
); );
foreach ( $tables as $name => $table ) { foreach ( $tables as $name => $table ) {