init
This commit is contained in:
19
vendor/yiisoft/yii2/views/_addForeignKeys.php
vendored
Normal file
19
vendor/yiisoft/yii2/views/_addForeignKeys.php
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php foreach ($foreignKeys as $column => $fkData): ?>
|
||||
|
||||
// creates index for column `<?= $column ?>`
|
||||
$this->createIndex(
|
||||
'<?= $fkData['idx'] ?>',
|
||||
'<?= $table ?>',
|
||||
'<?= $column ?>'
|
||||
);
|
||||
|
||||
// add foreign key for table `<?= $fkData['relatedTable'] ?>`
|
||||
$this->addForeignKey(
|
||||
'<?= $fkData['fk'] ?>',
|
||||
'<?= $table ?>',
|
||||
'<?= $column ?>',
|
||||
'<?= $fkData['relatedTable'] ?>',
|
||||
'<?= $fkData['relatedColumn'] ?>',
|
||||
'CASCADE'
|
||||
);
|
||||
<?php endforeach;
|
||||
Reference in New Issue
Block a user