1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- use yii\db\Migration;
- class m200109_135436_turbo extends Migration
- {
-
- public function safeUp()
- {
- if (class_exists('\wdmg\pages\models\Pages')) {
- $userTable = \wdmg\pages\models\Pages::tableName();
- if (is_null($this->getDb()->getSchema()->getTableSchema($userTable)->getColumn('in_turbo')))
- $this->addColumn($userTable, 'in_turbo', $this->boolean()->defaultValue(true));
- }
- }
-
- public function safeDown()
- {
- if (class_exists('\wdmg\pages\models\Pages')) {
- $userTable = \wdmg\pages\models\Pages::tableName();
- if (!is_null($this->getDb()->getSchema()->getTableSchema($userTable)->getColumn('in_turbo')))
- $this->dropColumn($userTable, 'in_turbo');
- }
- }
- }
|