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.
23 lines
606 B
23 lines
606 B
9 years ago
|
<?php
|
||
|
|
||
|
/**
|
||
|
* Creates a call for the method `yii\db\Migration::createTable()`
|
||
|
*/
|
||
|
/* @var $table string the name table */
|
||
|
/* @var $fields array the fields */
|
||
|
/* @var $foreignKeys array the foreign keys */
|
||
|
|
||
|
?> $this->createTable('<?= $table ?>', [
|
||
|
<?php foreach ($fields as $field):
|
||
|
if (empty($field['decorators'])): ?>
|
||
|
'<?= $field['property'] ?>',
|
||
|
<?php else: ?>
|
||
|
<?= "'{$field['property']}' => \$this->{$field['decorators']}" ?>,
|
||
|
<?php endif;
|
||
|
endforeach; ?>
|
||
|
]);
|
||
|
<?= $this->render('_addForeignKeys', [
|
||
|
'table' => $table,
|
||
|
'foreignKeys' => $foreignKeys,
|
||
|
]);
|