File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -681,6 +681,22 @@ public function testChangeColumnDefaultToZero()
681681 $ this ->assertSame (0 , $ columns ['column1 ' ]->getDefault ());
682682 }
683683
684+ public function testChangeColumnDefaultStringBoolean (): void
685+ {
686+ $ table = new Table ('t ' , [], $ this ->adapter );
687+ $ table ->addColumn ('column1 ' , 'boolean ' , ['default ' => 'true ' ])
688+ ->save ();
689+ $ columns = $ this ->adapter ->getColumns ('t ' );
690+ $ this ->assertSame (1 , $ columns ['column1 ' ]->getDefault ());
691+ $ newColumn1 = new Column ();
692+ $ newColumn1
693+ ->setType ('boolean ' )
694+ ->setDefault ('false ' );
695+ $ table ->changeColumn ('column1 ' , $ newColumn1 )->save ();
696+ $ columns = $ this ->adapter ->getColumns ('t ' );
697+ $ this ->assertSame (0 , $ columns ['column1 ' ]->getDefault ());
698+ }
699+
684700 public function testDropColumn ()
685701 {
686702 $ table = new Table ('t ' , [], $ this ->adapter );
You can’t perform that action at this time.
0 commit comments