@@ -530,14 +530,14 @@ class m200000_000000_change_table_fruits extends \yii\db\Migration
530
530
{
531
531
public function up()
532
532
{
533
- $this->dropColumn('{{%fruits}}', 'colour');
534
533
$this->dropColumn('{{%fruits}}', 'size');
534
+ $this->dropColumn('{{%fruits}}', 'colour');
535
535
}
536
536
537
537
public function down()
538
538
{
539
- $this->addColumn('{{%fruits}}', 'size', $this->text()->notNull());
540
539
$this->addColumn('{{%fruits}}', 'colour', $this->text()->notNull()->after('description'));
540
+ $this->addColumn('{{%fruits}}', 'size', $this->text()->notNull());
541
541
}
542
542
}
543
543
@@ -639,14 +639,14 @@ class m200000_000000_change_table_fruits extends \yii\db\Migration
639
639
{
640
640
public function up()
641
641
{
642
- $this->dropColumn('{{%fruits}}', 'description');
643
642
$this->dropColumn('{{%fruits}}', 'colour');
643
+ $this->dropColumn('{{%fruits}}', 'description');
644
644
}
645
645
646
646
public function down()
647
647
{
648
- $this->addColumn('{{%fruits}}', 'colour', $this->text()->notNull());
649
648
$this->addColumn('{{%fruits}}', 'description', $this->text()->notNull()->after('name'));
649
+ $this->addColumn('{{%fruits}}', 'colour', $this->text()->notNull());
650
650
}
651
651
}
652
652
@@ -693,14 +693,14 @@ class m200000_000000_change_table_fruits extends \yii\db\Migration
693
693
{
694
694
public function up()
695
695
{
696
- $this->dropColumn('{{%fruits}}', 'name');
697
696
$this->dropColumn('{{%fruits}}', 'colour');
697
+ $this->dropColumn('{{%fruits}}', 'name');
698
698
}
699
699
700
700
public function down()
701
701
{
702
- $this->addColumn('{{%fruits}}', 'colour', $this->text()->notNull()->after('description'));
703
702
$this->addColumn('{{%fruits}}', 'name', $this->text()->notNull()->after('id'));
703
+ $this->addColumn('{{%fruits}}', 'colour', $this->text()->notNull()->after('description'));
704
704
}
705
705
}
706
706
@@ -752,20 +752,24 @@ class m200000_000000_change_table_fruits extends \yii\db\Migration
752
752
{
753
753
public function up()
754
754
{
755
- $this->alterColumn('{{%fruits}}', 'colour', $this->text()->null()->after('id'));
756
- $this->alterColumn('{{%fruits}}', 'size', $this->text()->null()->after('colour'));
755
+ $this->dropColumn('{{%fruits}}', 'col_6');
756
+ $this->dropColumn('{{%fruits}}', 'size');
757
+ $this->dropColumn('{{%fruits}}', 'colour');
758
+ $this->dropColumn('{{%fruits}}', 'description');
757
759
}
758
760
759
761
public function down()
760
762
{
761
- $this->alterColumn('{{%fruits}}', 'size', $this->text()->null()->after('colour'));
762
- $this->alterColumn('{{%fruits}}', 'colour', $this->text()->null()->after('description'));
763
+ $this->addColumn('{{%fruits}}', 'description', $this->text()->null());
764
+ $this->addColumn('{{%fruits}}', 'colour', $this->text()->null());
765
+ $this->addColumn('{{%fruits}}', 'size', $this->text()->null());
766
+ $this->addColumn('{{%fruits}}', 'col_6', $this->text()->null());
763
767
}
764
768
}
765
769
766
770
PHP;
767
771
768
- $ this ->for58 ($ schema , $ expected , $ columns , ['Mysql ' , ' Mariadb ' ]);
772
+ $ this ->for58 ($ schema , $ expected , $ columns , ['Mysql ' ]);
769
773
}
770
774
771
775
// ------------ Add
@@ -1169,11 +1173,6 @@ public function test58Move1Add1Del1Col()
1169
1173
'description ' => 'text null ' ,
1170
1174
'colour ' => 'text null ' ,
1171
1175
'size ' => 'text null ' ,
1172
- // 'col_6' => 'text null',
1173
- // 'col_7' => 'text null',
1174
- // 'col_8' => 'text null',
1175
- // 'col_9' => 'text null',
1176
-
1177
1176
];
1178
1177
1179
1178
$ schema = <<<YAML
@@ -1189,7 +1188,7 @@ public function test58Move1Add1Del1Col()
1189
1188
id:
1190
1189
type: integer
1191
1190
colour:
1192
- type: string
1191
+ type: string
1193
1192
name:
1194
1193
type: string
1195
1194
description:
@@ -1214,14 +1213,20 @@ class m200000_000000_change_table_fruits extends \yii\db\Migration
1214
1213
{
1215
1214
public function up()
1216
1215
{
1216
+ $this->addColumn('{{%fruits}}', 'col_6', $this->text()->null());
1217
+ $this->dropColumn('{{%fruits}}', 'size');
1217
1218
$this->alterColumn('{{%fruits}}', 'colour', $this->text()->null()->after('id'));
1218
- $this->alterColumn('{{%fruits}}', 'size', $this->text()->null()->after('colour'));
1219
+ $this->alterColumn('{{%fruits}}', 'name', $this->text()->null()->after('colour'));
1220
+ $this->alterColumn('{{%fruits}}', 'description', $this->text()->null()->after('name'));
1219
1221
}
1220
1222
1221
1223
public function down()
1222
1224
{
1223
- $this->alterColumn('{{%fruits}}', 'size', $this->text()->null()->after('colour'));
1225
+ $this->alterColumn('{{%fruits}}', 'description', $this->text()->null()->after('name'));
1226
+ $this->alterColumn('{{%fruits}}', 'name', $this->text()->null()->after('id'));
1224
1227
$this->alterColumn('{{%fruits}}', 'colour', $this->text()->null()->after('description'));
1228
+ $this->addColumn('{{%fruits}}', 'size', $this->text()->null()->after('colour'));
1229
+ $this->dropColumn('{{%fruits}}', 'col_6');
1225
1230
}
1226
1231
}
1227
1232
0 commit comments