File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed
Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,19 @@ public function testIsDiffingChangedTable()
7474 $ differ ->diffChangedTable ($ changedTable );
7575 }
7676
77+ public function testIsDiffingChangedComment ()
78+ {
79+ $ parser = new Parser ();
80+
81+ $ fromDatabase = $ parser ->parseDatabase ($ this ->getDatabaseFixture ('comment_change1.sql ' ));
82+ $ toDatabase = $ parser ->parseDatabase ($ this ->getDatabaseFixture ('comment_change2.sql ' ));
83+
84+ $ differ = new Differ ();
85+ $ databaseDiff = $ differ ->diffDatabases ($ fromDatabase , $ toDatabase );
86+
87+ $ this ->assertContains ('CHANGE COLUMN `field1` `field1` varchar(50) NOT NULL COMMENT \'New Comment \' FIRST; ' , $ differ ->generateMigrationScript ($ databaseDiff ));
88+ }
89+
7790 public function testIsGeneratingMigrationScript ()
7891 {
7992 $ parser = new Parser ();
Original file line number Diff line number Diff line change 1+ CREATE TABLE `comments ` (
2+ ` field1` varchar (50 ) NOT NULL COMMENT ' Old Comment' ,
3+ ) ENGINE= InnoDB;
Original file line number Diff line number Diff line change 1+ CREATE TABLE `comments ` (
2+ ` field1` varchar (50 ) NOT NULL COMMENT ' New Comment' ,
3+ ) ENGINE= InnoDB;
You can’t perform that action at this time.
0 commit comments