| 1 |
<?php |
| 2 |
|
| 3 |
namespace StoreEngine\Database; |
| 4 |
|
| 5 |
if ( ! defined( 'ABSPATH' ) ) { |
| 6 |
exit; |
| 7 |
} |
| 8 |
|
| 9 |
class CreateOrderOperationalData { |
| 10 |
|
| 11 |
public static function up( $prefix, $charset_collate ) { |
| 12 |
$table_name = $prefix . 'storeengine_order_operational_data'; |
| 13 |
$sql = "CREATE TABLE IF NOT EXISTS {$table_name} ( |
| 14 |
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, |
| 15 |
`order_id` bigint(20) unsigned DEFAULT NULL, |
| 16 |
`created_via` varchar(100) DEFAULT NULL, |
| 17 |
`storeengine_version` varchar(20) DEFAULT NULL, |
| 18 |
`prices_include_tax` tinyint(1) DEFAULT NULL, |
| 19 |
`coupon_usages_are_counted` tinyint(1) DEFAULT NULL, |
| 20 |
`download_permission_granted` tinyint(1) DEFAULT NULL, |
| 21 |
`cart_hash` varchar(100) DEFAULT NULL, |
| 22 |
`new_order_email_sent` tinyint(1) DEFAULT NULL, |
| 23 |
`order_key` varchar(100) DEFAULT NULL, |
| 24 |
`order_stock_reduced` tinyint(1) DEFAULT NULL, |
| 25 |
`date_paid_gmt` datetime DEFAULT NULL, |
| 26 |
`date_completed_gmt` datetime DEFAULT NULL, |
| 27 |
`shipping_tax_amount` decimal(26,8) DEFAULT NULL, |
| 28 |
`shipping_total_amount` decimal(26,8) DEFAULT NULL, |
| 29 |
`discount_tax_amount` decimal(26,8) DEFAULT NULL, |
| 30 |
`discount_total_amount` decimal(26,8) DEFAULT NULL, |
| 31 |
`recorded_sales` tinyint(1) DEFAULT NULL, |
| 32 |
PRIMARY KEY (`id`), |
| 33 |
UNIQUE KEY `order_id` (`order_id`), |
| 34 |
KEY `order_key` (`order_key`) |
| 35 |
) $charset_collate;"; |
| 36 |
|
| 37 |
dbDelta( $sql ); |
| 38 |
} |
| 39 |
} |
| 40 |
|