|
| 1 | +<?php |
| 2 | + |
| 3 | +/** |
| 4 | + * Table for Routing |
| 5 | + */ |
| 6 | +class m230320_130007_create_table_routings extends \yii\db\Migration |
| 7 | +{ |
| 8 | + public function up() |
| 9 | + { |
| 10 | + $this->createTable('{{%routings}}', [ |
| 11 | + 'id' => $this->primaryKey(), |
| 12 | + 'domain_id' => $this->integer()->notNull(), |
| 13 | + 'path' => $this->string(255)->null()->defaultValue(null), |
| 14 | + 'ssl' => $this->boolean()->null()->defaultValue(null), |
| 15 | + 'redirect_to_ssl' => $this->boolean()->null()->defaultValue(null), |
| 16 | + 'service' => $this->string(255)->null()->defaultValue(null), |
| 17 | + 0 => 'created_at datetime NULL DEFAULT NULL', |
| 18 | + 'd123_id' => $this->integer()->null()->defaultValue(null), |
| 19 | + 'a123_id' => $this->integer()->null()->defaultValue(null), |
| 20 | + ]); |
| 21 | + $this->addForeignKey('fk_routings_domain_id_domains_id', '{{%routings}}', 'domain_id', '{{%domains}}', 'id'); |
| 22 | + $this->addForeignKey('fk_routings_d123_id_d123s_id', '{{%routings}}', 'd123_id', '{{%d123s}}', 'id'); |
| 23 | + $this->addForeignKey('fk_routings_a123_id_a123s_id', '{{%routings}}', 'a123_id', '{{%a123s}}', 'id'); |
| 24 | + } |
| 25 | + |
| 26 | + public function down() |
| 27 | + { |
| 28 | + $this->dropForeignKey('fk_routings_a123_id_a123s_id', '{{%routings}}'); |
| 29 | + $this->dropForeignKey('fk_routings_d123_id_d123s_id', '{{%routings}}'); |
| 30 | + $this->dropForeignKey('fk_routings_domain_id_domains_id', '{{%routings}}'); |
| 31 | + $this->dropTable('{{%routings}}'); |
| 32 | + } |
| 33 | +} |
0 commit comments