# fluent-cart/1.6.4/database/Migrations/ShippingClassesMigrator.php

FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler, version 1.6.4. 30 lines.

- Page: https://pluginprobe.com/plugins/fluent-cart/1.6.4/code/database/Migrations/ShippingClassesMigrator.php
- Raw: https://pluginprobe.com/plugins/fluent-cart/1.6.4/raw/database/Migrations/ShippingClassesMigrator.php
- Modified: 2026-04-20T13:45:50+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.6.4/code/database/Migrations/ShippingClassesMigrator.php#L10-L20`.

```php
<?php

namespace FluentCart\Database\Migrations;

class ShippingClassesMigrator extends Migrator
{
    public static string $tableName = 'fct_shipping_classes';

    public static function getSqlSchema(): string
    {
        $indexPrefix = static::getDbPrefix() . 'fct_sc_';
        return "`id` BIGINT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
                `name` VARCHAR(192) NOT NULL,
                `description` VARCHAR(500) NULL,
                `cost` DECIMAL(10, 2) NOT NULL DEFAULT 0.00,
                `per_item` TINYINT(1) NOT NULL DEFAULT 0,
                `type` VARCHAR(20) NOT NULL DEFAULT 'fixed',
                `created_at` DATETIME NULL,
                `updated_at` DATETIME NULL,

                INDEX `{$indexPrefix}_name_idx` (`name` ASC)";
    }

    public static function migrated()
    {
        // Ensure description exists on upgrades (fresh installs get it from getSqlSchema)
        static::addColumnIfNotExists('description', 'VARCHAR(500) NULL', 'name');
    }
}

```
