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

@ -53,9 +53,13 @@ final class CreateSources extends AbstractMigration
'encoding' => 'utf8mb4',
'after' => 'url',
])
->addIndex(['currency_id'], [
/*->addIndex(['currency_id'], [
'name' => 'currency_id',
'unique' => false,
])*/
->addForeignKey(['currency_id'], 'currencies', ['id'], [
'delete' => 'CASCADE',
'update' => 'CASCADE'
])
->create();
}