You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
916 B
31 lines
916 B
7 years ago
|
<?php
|
||
|
namespace Application\Migrations;
|
||
|
|
||
|
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||
|
use Doctrine\DBAL\Schema\Schema;
|
||
|
|
||
|
class VersionTos20180615080524 extends AbstractMigration
|
||
|
{
|
||
|
|
||
|
public function up(Schema $schema)
|
||
|
{
|
||
|
$tos = $schema->getTable('vierbergenlars_tos');
|
||
|
|
||
|
foreach ($tos->getForeignKeys() as $fk) {
|
||
|
$tos->removeForeignKey($fk->getName());
|
||
|
$tos->addForeignKeyConstraint($fk->getForeignTableName(), $fk->getColumns(), $fk->getForeignColumns(), [
|
||
|
'onDelete' => 'CASCADE'
|
||
|
]);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public function down(Schema $schema)
|
||
|
{
|
||
|
$tos = $schema->getTable('vierbergenlars_tos');
|
||
|
foreach ($tos->getForeignKeys() as $fk) {
|
||
|
$tos->removeForeignKey($fk->getName());
|
||
|
$tos->addForeignKeyConstraint($fk->getForeignTableName(), $fk->getColumns(), $fk->getForeignColumns());
|
||
|
}
|
||
|
}
|
||
|
}
|