PluginProbe
StoreEngine — Complete eCommerce Solution with Memberships, Licensing, Affiliates & More / 2.2.0
StoreEngine — Complete eCommerce Solution with Memberships, Licensing, Affiliates & More v2.2.0
2.3.0 2.2.0 2.1.1 2.1.0 2.0.0 1.10.0 1.9.1 1.9.0 1.2.1 1.2.2 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.6.0 All 59 releases
storeengine / includes / database / create-product-variations-table.php

create-product-variations-table.php in StoreEngine — Complete eCommerce Solution with Memberships, Licensing, Affiliates & More 2.2.0, at includes/database/create-product-variations-table.php

40 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace StoreEngine\Database;
4
5 if ( ! defined( 'ABSPATH' ) ) {
6 exit;
7 }
8
9 class CreateProductVariationsTable {
10
11 public static function up( $prefix, $charset_collate ) {
12 $table_name = $prefix . 'storeengine_product_variations';
13 $sql = "CREATE TABLE IF NOT EXISTS {$table_name} (
14 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
15 sku VARCHAR(255) NOT NULL,
16 barcode VARCHAR(64) DEFAULT NULL,
17 product_id BIGINT(20) UNSIGNED NOT NULL,
18 price decimal(26,8),
19 compare_price decimal(26,8),
20 cost_price decimal(26,8) DEFAULT NULL,
21 manage_stock TINYINT(1) NOT NULL DEFAULT 0,
22 stock_quantity INT(11) DEFAULT NULL,
23 stock_status VARCHAR(32) NOT NULL DEFAULT 'instock',
24 backorders VARCHAR(16) NOT NULL DEFAULT 'no',
25 low_stock_threshold INT(11) DEFAULT NULL,
26 reorder_point INT(11) DEFAULT NULL,
27 reorder_qty INT(11) DEFAULT NULL,
28 preferred_supplier_id BIGINT(20) UNSIGNED DEFAULT NULL,
29 PRIMARY KEY (id),
30 KEY product_id (product_id),
31 KEY stock_status (stock_status),
32 KEY sku (sku),
33 KEY barcode (barcode),
34 KEY preferred_supplier_id (preferred_supplier_id)
35 ) $charset_collate;";
36
37 dbDelta( $sql );
38 }
39 }
40