PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.3.19
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.3.19
1.6.5 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 All 48 releases
fluent-cart / database / Migrations / OrderAddressesMigrator.php

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

37 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 FluentCart\Database\Migrations;
4
5 class OrderAddressesMigrator extends Migrator
6 {
7 public static string $tableName = 'fct_order_addresses';
8
9 public static function getSqlSchema(): string
10 {
11 return "`id` BIGINT(20) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
12 `order_id` BIGINT UNSIGNED NOT NULL,
13 `type` VARCHAR(20) NOT NULL DEFAULT 'billing',
14 `name` VARCHAR(192) NULL,
15 `address_1` VARCHAR(192) NULL,
16 `address_2` VARCHAR(192) NULL,
17 `city` VARCHAR(192) NULL,
18 `state` VARCHAR(192) NULL,
19 `postcode` VARCHAR(50) NULL,
20 `country` VARCHAR(100) NULL,
21 `meta` JSON DEFAULT NULL,
22 `created_at` DATETIME NULL,
23 `updated_at` DATETIME NULL";
24 }
25
26 public static function migrated()
27 {
28 static::addMetaColumn();
29 }
30
31 public static function addMetaColumn()
32 {
33 // "ALTER TABLE %i ADD COLUMN `meta` JSON DEFAULT NULL AFTER `country`"
34 static::addColumnIfNotExists('meta', 'JSON DEFAULT NULL', 'country');
35 }
36 }
37