Migration foreign keys

This commit is contained in:
2021-04-13 23:03:25 -04:00
parent 3651969c33
commit f9a00578f4
3 changed files with 73 additions and 2 deletions

View File

@ -34,13 +34,21 @@ class CreateValues extends Phinx\Migration\AbstractMigration
'signed' => false,
'after' => 'value',
])
->addIndex(['currency_id'], [
/*->addIndex(['currency_id'], [
'name' => 'currency_id',
'unique' => false,
])
->addIndex(['base_id'], [
'name' => 'base_id',
'unique' => false,
])*/
->addForeignKey(['currency_id'], 'currencies', ['id'], [
'delete' => 'CASCADE',
'update' => 'CASCADE'
])
->addForeignKey(['base_id'], 'currencies', ['id'], [
'delete' => 'CASCADE',
'update' => 'CASCADE'
])
->create();
/*$this->table('currencies', [