Migraciones

This commit is contained in:
2021-03-16 00:43:14 -03:00
parent bfaf2b354e
commit cd6a949e23
7 changed files with 682 additions and 2 deletions

View File

@ -0,0 +1,40 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateCurrencies extends Phinx\Migration\AbstractMigration
{
public function change()
{
$this->table('currencies', [
'id' => false,
'primary_key' => ['id'],
'engine' => 'InnoDB',
'encoding' => 'utf8mb4',
'collation' => 'utf8mb4_general_ci',
'comment' => '',
'row_format' => 'DYNAMIC',
])
->addColumn('id', 'integer', [
'null' => false,
'limit' => '10',
'signed' => false,
'identity' => 'enable',
])
->addColumn('code', 'string', [
'null' => false,
'limit' => 5,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'id',
])
->addColumn('name', 'string', [
'null' => false,
'limit' => 100,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'code',
])
->create();
}
}