# fluent-cart/1.3.19/database/Migrations/OrderAddressesMigrator.php

FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler, version 1.3.19. 37 lines.

- Page: https://pluginprobe.com/plugins/fluent-cart/1.3.19/code/database/Migrations/OrderAddressesMigrator.php
- Raw: https://pluginprobe.com/plugins/fluent-cart/1.3.19/raw/database/Migrations/OrderAddressesMigrator.php
- Modified: 2026-04-07T13:41:30+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/fluent-cart/1.3.19/code/database/Migrations/OrderAddressesMigrator.php#L10-L20`.

```php
<?php

namespace FluentCart\Database\Migrations;

class OrderAddressesMigrator extends Migrator
{
    public static string $tableName = 'fct_order_addresses';

    public static function getSqlSchema(): string
    {
        return "`id` BIGINT(20) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
                `order_id` BIGINT UNSIGNED NOT NULL,
                `type` VARCHAR(20) NOT NULL DEFAULT 'billing',
                `name` VARCHAR(192) NULL,
                `address_1` VARCHAR(192) NULL,
                `address_2` VARCHAR(192) NULL,
                `city` VARCHAR(192) NULL,
                `state` VARCHAR(192) NULL,
                `postcode` VARCHAR(50) NULL,
                `country` VARCHAR(100) NULL,
                `meta` JSON DEFAULT NULL,
                `created_at` DATETIME NULL,
                `updated_at` DATETIME NULL";
    }

    public static function migrated()
    {
        static::addMetaColumn();
    }

    public static function addMetaColumn()
    {
        // "ALTER TABLE %i ADD COLUMN `meta` JSON DEFAULT NULL AFTER `country`"
        static::addColumnIfNotExists('meta', 'JSON DEFAULT NULL', 'country');
    }
}

```
