File tree Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -300,13 +300,10 @@ public function createTable(string $name): Table
300
300
*/
301
301
public function renameTable (string $ oldName , string $ newName ): self
302
302
{
303
- $ table = $ this ->getTable ($ oldName );
304
-
305
- $ identifier = new Identifier ($ newName );
306
-
307
- $ table ->_name = $ identifier ->_name ;
308
- $ table ->_namespace = $ identifier ->_namespace ;
309
- $ table ->_quoted = $ identifier ->_quoted ;
303
+ $ table = $ this ->getTable ($ oldName )
304
+ ->edit ()
305
+ ->setName ($ newName )
306
+ ->create ();
310
307
311
308
$ this ->dropTable ($ oldName );
312
309
$ this ->_addTable ($ table );
Original file line number Diff line number Diff line change @@ -71,15 +71,13 @@ public function testCreateTableTwiceThrowsException(): void
71
71
72
72
public function testRenameTable (): void
73
73
{
74
- $ tableName = 'foo ' ;
75
- $ table = new Table ($ tableName );
76
- $ schema = new Schema ([$ table ]);
74
+ $ table = new Table ('foo ' );
75
+ $ schema = new Schema ([$ table ]);
77
76
78
77
self ::assertTrue ($ schema ->hasTable ('foo ' ));
79
78
$ schema ->renameTable ('foo ' , 'bar ' );
80
79
self ::assertFalse ($ schema ->hasTable ('foo ' ));
81
80
self ::assertTrue ($ schema ->hasTable ('bar ' ));
82
- self ::assertSame ($ table , $ schema ->getTable ('bar ' ));
83
81
}
84
82
85
83
public function testDropTable (): void
You can’t perform that action at this time.
0 commit comments