17 lines
582 B
PHP
17 lines
582 B
PHP
|
<?php
|
||
|
declare(strict_types=1);
|
||
|
|
||
|
use Phinx\Migration\AbstractMigration;
|
||
|
|
||
|
final class TransaccionForeign extends AbstractMigration
|
||
|
{
|
||
|
public function change(): void
|
||
|
{
|
||
|
$this->table('transacciones')
|
||
|
->addForeignKey('cuenta_id', 'cuentas', ['id'], ['delete' => 'cascade', 'update' => 'cascade'])
|
||
|
->addForeignKey('tipo_id', 'tipos_transacciones', ['id'], ['delete' => 'cascade', 'update' => 'cascade'])
|
||
|
->addForeignKey('categoria_id', 'categorias', ['id'], ['delete' => 'cascade', 'update' => 'cascade'])
|
||
|
->update();
|
||
|
}
|
||
|
}
|