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

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

- Page: https://pluginprobe.com/plugins/fluent-cart/1.3.19/code/database/Migrations/OrderMetaMigrator.php
- Raw: https://pluginprobe.com/plugins/fluent-cart/1.3.19/raw/database/Migrations/OrderMetaMigrator.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/OrderMetaMigrator.php#L10-L20`.

```php
<?php

namespace FluentCart\Database\Migrations;

class OrderMetaMigrator extends Migrator
{

    public static string $tableName = 'fct_order_meta';

    public static function getSqlSchema(): string
    {
        $indexPrefix = static::getDbPrefix() . 'fct_om_';
        return "`id` BIGINT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
                `order_id` BIGINT(20) NULL,
                `meta_key` VARCHAR(192) NOT NULL,
                `meta_value` LONGTEXT NULL,
                `created_at` DATETIME NULL,
                `updated_at` DATETIME NULL,

                INDEX `{$indexPrefix}_ord_id_idx` (`order_id` ASC)";
    }

    public static function migrated()
    {
        static::renameKeyToMetaKey();
        static::renameValueToMetaValue();
    }

    public static function renameKeyToMetaKey()
    {
        // "ALTER TABLE %i CHANGE `key` `meta_key` VARCHAR(192)"
        static::renameColumnIfExists('key', 'meta_key', 'VARCHAR(192)');
    }

    public static function renameValueToMetaValue()
    {
        // "ALTER TABLE %i CHANGE `value` `meta_value` LONGTEXT"
        static::renameColumnIfExists('value', 'meta_value', 'LONGTEXT');
    }
}

```
