| Total Complexity | 4 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class m190401_220828_longer_handles extends Migration |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @inheritdoc |
||
| 14 | */ |
||
| 15 | public function safeUp() |
||
| 16 | { |
||
| 17 | // https://github.com/yiisoft/yii2/issues/4492 |
||
| 18 | if ($this->db->getIsPgsql()) { |
||
| 19 | $this->alterColumn( |
||
| 20 | '{{%seomatic_metabundles}}', |
||
| 21 | 'sourceHandle', |
||
| 22 | $this->string() |
||
| 23 | ); |
||
| 24 | $this->alterColumn( |
||
| 25 | '{{%seomatic_metabundles}}', |
||
| 26 | 'sourceHandle', |
||
| 27 | "SET DEFAULT ''" |
||
| 28 | ); |
||
| 29 | } |
||
| 30 | if ($this->db->getIsMysql()) { |
||
| 31 | $this->alterColumn( |
||
| 32 | '{{%seomatic_metabundles}}', |
||
| 33 | 'sourceHandle', |
||
| 34 | $this->string()->defaultValue('') |
||
| 35 | ); |
||
| 36 | } |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @inheritdoc |
||
| 41 | */ |
||
| 42 | public function safeDown() |
||
| 46 | } |
||
| 47 | } |
||
| 48 |