| 1 |
<?php |
| 2 |
|
| 3 |
namespace StoreEngine\Database; |
| 4 |
|
| 5 |
if ( ! defined( 'ABSPATH' ) ) { |
| 6 |
exit; |
| 7 |
} |
| 8 |
|
| 9 |
class CreateIntegration { |
| 10 |
|
| 11 |
public static function up( $prefix, $charset_collate ) { |
| 12 |
$table_name = $prefix . 'storeengine_integrations'; |
| 13 |
$sql = "CREATE TABLE IF NOT EXISTS {$table_name} ( |
| 14 |
id bigint(20) unsigned NOT NULL auto_increment, |
| 15 |
product_id bigint(20) unsigned NOT NULL, |
| 16 |
price_id bigint(20) unsigned NOT NULL, |
| 17 |
integration_id bigint(20) unsigned NOT NULL, |
| 18 |
provider varchar(155) NOT NULL, |
| 19 |
variation_id bigint(20) unsigned, |
| 20 |
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, |
| 21 |
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
| 22 |
PRIMARY KEY (id), |
| 23 |
INDEX product_id (product_id), |
| 24 |
INDEX price_id (price_id), |
| 25 |
INDEX integration_id (integration_id), |
| 26 |
INDEX variation_id (variation_id) |
| 27 |
) $charset_collate;"; |
| 28 |
|
| 29 |
dbDelta( $sql ); |
| 30 |
} |
| 31 |
} |
| 32 |
|