src/Phinx/Db/Adapter/MysqlAdapter.php 1 location
|
@@ 361-371 (lines=11) @@
|
| 358 |
|
/** |
| 359 |
|
* @inheritDoc |
| 360 |
|
*/ |
| 361 |
|
protected function getRenameTableInstructions($tableName, $newTableName) |
| 362 |
|
{ |
| 363 |
|
$this->updateCreatedTableName($tableName, $newTableName); |
| 364 |
|
$sql = sprintf( |
| 365 |
|
'RENAME TABLE %s TO %s', |
| 366 |
|
$this->quoteTableName($tableName), |
| 367 |
|
$this->quoteTableName($newTableName) |
| 368 |
|
); |
| 369 |
|
|
| 370 |
|
return new AlterInstructions([], [$sql]); |
| 371 |
|
} |
| 372 |
|
|
| 373 |
|
/** |
| 374 |
|
* @inheritDoc |
src/Phinx/Db/Adapter/SqlServerAdapter.php 1 location
|
@@ 364-374 (lines=11) @@
|
| 361 |
|
/** |
| 362 |
|
* @inheritDoc |
| 363 |
|
*/ |
| 364 |
|
protected function getRenameTableInstructions($tableName, $newTableName) |
| 365 |
|
{ |
| 366 |
|
$this->updateCreatedTableName($tableName, $newTableName); |
| 367 |
|
$sql = sprintf( |
| 368 |
|
"EXEC sp_rename '%s', '%s'", |
| 369 |
|
$tableName, |
| 370 |
|
$newTableName |
| 371 |
|
); |
| 372 |
|
|
| 373 |
|
return new AlterInstructions([], [$sql]); |
| 374 |
|
} |
| 375 |
|
|
| 376 |
|
/** |
| 377 |
|
* @inheritDoc |
src/Phinx/Db/Adapter/SQLiteAdapter.php 1 location
|
@@ 461-471 (lines=11) @@
|
| 458 |
|
/** |
| 459 |
|
* @inheritDoc |
| 460 |
|
*/ |
| 461 |
|
protected function getRenameTableInstructions($tableName, $newTableName) |
| 462 |
|
{ |
| 463 |
|
$this->updateCreatedTableName($tableName, $newTableName); |
| 464 |
|
$sql = sprintf( |
| 465 |
|
'ALTER TABLE %s RENAME TO %s', |
| 466 |
|
$this->quoteTableName($tableName), |
| 467 |
|
$this->quoteTableName($newTableName) |
| 468 |
|
); |
| 469 |
|
|
| 470 |
|
return new AlterInstructions([], [$sql]); |
| 471 |
|
} |
| 472 |
|
|
| 473 |
|
/** |
| 474 |
|
* @inheritDoc |
src/Phinx/Db/Adapter/PostgresAdapter.php 1 location
|
@@ 345-355 (lines=11) @@
|
| 342 |
|
/** |
| 343 |
|
* @inheritDoc |
| 344 |
|
*/ |
| 345 |
|
protected function getRenameTableInstructions($tableName, $newTableName) |
| 346 |
|
{ |
| 347 |
|
$this->updateCreatedTableName($tableName, $newTableName); |
| 348 |
|
$sql = sprintf( |
| 349 |
|
'ALTER TABLE %s RENAME TO %s', |
| 350 |
|
$this->quoteTableName($tableName), |
| 351 |
|
$this->quoteColumnName($newTableName) |
| 352 |
|
); |
| 353 |
|
|
| 354 |
|
return new AlterInstructions([], [$sql]); |
| 355 |
|
} |
| 356 |
|
|
| 357 |
|
/** |
| 358 |
|
* @inheritDoc |