Просмотр файла database/migrations/20180420180042_create_stickers_table.php

Размер файла: 627B
<?php

use Phinx\Migration\AbstractMigration;

class CreateStickersTable extends AbstractMigration
{
    /**
     * Change Method.
     */
    public function change(): void
    {
        if (! $this->hasTable('stickers')) {
            $table = $this->table('stickers', ['engine' => config('DB_ENGINE'), 'collation' => config('DB_COLLATION')]);
            $table
                ->addColumn('category_id', 'integer')
                ->addColumn('name', 'string', ['limit' => 100])
                ->addColumn('code', 'string', ['limit' => 20])
                ->addIndex('code')
                ->create();
        }
    }
}