| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 39 | 1 | public function renameView($from, $to) |
|
| 40 | { |
||
| 41 | 1 | $view = $this->connection->selectOne( |
|
| 42 | 1 | "select * from sqlite_master where type = 'view' and name = ?", |
|
| 43 | 1 | [$this->connection->getTablePrefix().$from] |
|
| 44 | ); |
||
| 45 | |||
| 46 | 1 | $this->dropView($from); |
|
| 47 | |||
| 48 | 1 | $query = Str::replaceFirst( |
|
| 49 | 1 | $this->grammar->wrapTable($from), |
|
| 50 | 1 | $this->grammar->wrapTable($to), |
|
| 51 | 1 | $view->sql |
|
| 52 | ); |
||
| 53 | |||
| 54 | 1 | $this->connection->statement($query); |
|
| 55 | 1 | } |
|
| 68 |