PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.4
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.4
1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 trunk 1.2.0 All 47 releases
fluent-cart / database / Migrations / ProductDetailsMigrator.php

ProductDetailsMigrator.php in FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler 1.6.4, at database/Migrations/ProductDetailsMigrator.php

33 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentCart\Database\Migrations;
4
5 use FluentCart\Framework\Database\Schema;
6
7 class ProductDetailsMigrator extends Migrator
8 {
9 public static string $tableName = 'fct_product_details';
10
11 public static function getSqlSchema(): string
12 {
13 $indexPrefix = static::getDbPrefix() . 'fct_pd_';
14 return "`id` BIGINT(20) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
15 `post_id` BIGINT(20) UNSIGNED NOT NULL,
16 `fulfillment_type` VARCHAR(100) NULL DEFAULT 'physical', /* physical, digital, service, mixed */
17 `min_price` double DEFAULT 0 NOT NULL,
18 `max_price` double DEFAULT 0 NOT NULL,
19 `default_variation_id` BIGINT(20) UNSIGNED NULL,
20 `default_media` json NULL,
21 `manage_stock` TINYINT(1) NULL DEFAULT 0,
22 `stock_availability` VARCHAR(100) NULL DEFAULT 'in-stock', /* computed : in-stock, out-of-stock, backorder*/
23 `variation_type` VARCHAR(30) NULL DEFAULT 'simple', /* simple, simple_variation, advance_variation*/
24 `manage_downloadable` TINYINT(1) NULL DEFAULT 0,
25 `other_info` json NULL,
26 `created_at` DATETIME NULL,
27 `updated_at` DATETIME NULL,
28
29 INDEX `{$indexPrefix}_product_id_idx` (`post_id` ASC),
30 INDEX `{$indexPrefix}_product_stock_stockx` (`stock_availability` ASC)";
31 }
32 }
33