| @@ 175-185 (lines=11) @@ | ||
| 172 | /** |
|
| 173 | * {@inheritdoc} |
|
| 174 | */ |
|
| 175 | public function renameTable($tableName, $newTableName) |
|
| 176 | { |
|
| 177 | $adapter = $this->getAdapter(); |
|
| 178 | if (!$adapter instanceof DirectActionInterface) { |
|
| 179 | throw new \BadMethodCallException('The adapter needs to implement DirectActionInterface'); |
|
| 180 | } |
|
| 181 | $end = $this->startCommandTimer(); |
|
| 182 | $this->writeCommand('renameTable', [$tableName, $newTableName]); |
|
| 183 | $adapter->renameTable($tableName, $newTableName); |
|
| 184 | $end(); |
|
| 185 | } |
|
| 186 | ||
| 187 | /** |
|
| 188 | * {@inheritdoc} |
|
| @@ 238-248 (lines=11) @@ | ||
| 235 | /** |
|
| 236 | * {@inheritdoc} |
|
| 237 | */ |
|
| 238 | public function renameColumn($tableName, $columnName, $newColumnName) |
|
| 239 | { |
|
| 240 | $adapter = $this->getAdapter(); |
|
| 241 | if (!$adapter instanceof DirectActionInterface) { |
|
| 242 | throw new \BadMethodCallException('The adapter needs to implement DirectActionInterface'); |
|
| 243 | } |
|
| 244 | $end = $this->startCommandTimer(); |
|
| 245 | $this->writeCommand('renameColumn', [$tableName, $columnName, $newColumnName]); |
|
| 246 | $adapter->renameColumn($tableName, $columnName, $newColumnName); |
|
| 247 | $end(); |
|
| 248 | } |
|
| 249 | ||
| 250 | /** |
|
| 251 | * {@inheritdoc} |
|
| @@ 253-263 (lines=11) @@ | ||
| 250 | /** |
|
| 251 | * {@inheritdoc} |
|
| 252 | */ |
|
| 253 | public function changeColumn($tableName, $columnName, Column $newColumn) |
|
| 254 | { |
|
| 255 | $adapter = $this->getAdapter(); |
|
| 256 | if (!$adapter instanceof DirectActionInterface) { |
|
| 257 | throw new \BadMethodCallException('The adapter needs to implement DirectActionInterface'); |
|
| 258 | } |
|
| 259 | $end = $this->startCommandTimer(); |
|
| 260 | $this->writeCommand('changeColumn', [$tableName, $columnName, $newColumn->getType()]); |
|
| 261 | $adapter->changeColumn($tableName, $columnName, $newColumn); |
|
| 262 | $end(); |
|
| 263 | } |
|
| 264 | ||
| 265 | /** |
|
| 266 | * {@inheritdoc} |
|
| @@ 268-278 (lines=11) @@ | ||
| 265 | /** |
|
| 266 | * {@inheritdoc} |
|
| 267 | */ |
|
| 268 | public function dropColumn($tableName, $columnName) |
|
| 269 | { |
|
| 270 | $adapter = $this->getAdapter(); |
|
| 271 | if (!$adapter instanceof DirectActionInterface) { |
|
| 272 | throw new \BadMethodCallException('The adapter needs to implement DirectActionInterface'); |
|
| 273 | } |
|
| 274 | $end = $this->startCommandTimer(); |
|
| 275 | $this->writeCommand('dropColumn', [$tableName, $columnName]); |
|
| 276 | $adapter->dropColumn($tableName, $columnName); |
|
| 277 | $end(); |
|
| 278 | } |
|
| 279 | ||
| 280 | /** |
|
| 281 | * {@inheritdoc} |
|
| @@ 298-308 (lines=11) @@ | ||
| 295 | /** |
|
| 296 | * {@inheritdoc} |
|
| 297 | */ |
|
| 298 | public function dropIndex($tableName, $columns) |
|
| 299 | { |
|
| 300 | $adapter = $this->getAdapter(); |
|
| 301 | if (!$adapter instanceof DirectActionInterface) { |
|
| 302 | throw new \BadMethodCallException('The adapter needs to implement DirectActionInterface'); |
|
| 303 | } |
|
| 304 | $end = $this->startCommandTimer(); |
|
| 305 | $this->writeCommand('dropIndex', [$tableName, $columns]); |
|
| 306 | $adapter->dropIndex($tableName, $columns); |
|
| 307 | $end(); |
|
| 308 | } |
|
| 309 | ||
| 310 | /** |
|
| 311 | * {@inheritdoc} |
|
| @@ 313-323 (lines=11) @@ | ||
| 310 | /** |
|
| 311 | * {@inheritdoc} |
|
| 312 | */ |
|
| 313 | public function dropIndexByName($tableName, $indexName) |
|
| 314 | { |
|
| 315 | $adapter = $this->getAdapter(); |
|
| 316 | if (!$adapter instanceof DirectActionInterface) { |
|
| 317 | throw new \BadMethodCallException('The adapter needs to implement DirectActionInterface'); |
|
| 318 | } |
|
| 319 | $end = $this->startCommandTimer(); |
|
| 320 | $this->writeCommand('dropIndexByName', [$tableName, $indexName]); |
|
| 321 | $adapter->dropIndexByName($tableName, $indexName); |
|
| 322 | $end(); |
|
| 323 | } |
|
| 324 | ||
| 325 | /** |
|
| 326 | * {@inheritdoc} |
|
| @@ 343-353 (lines=11) @@ | ||
| 340 | /** |
|
| 341 | * {@inheritdoc} |
|
| 342 | */ |
|
| 343 | public function dropForeignKey($tableName, $columns, $constraint = null) |
|
| 344 | { |
|
| 345 | $adapter = $this->getAdapter(); |
|
| 346 | if (!$adapter instanceof DirectActionInterface) { |
|
| 347 | throw new \BadMethodCallException('The adapter needs to implement DirectActionInterface'); |
|
| 348 | } |
|
| 349 | $end = $this->startCommandTimer(); |
|
| 350 | $this->writeCommand('dropForeignKey', [$tableName, $columns]); |
|
| 351 | $adapter->dropForeignKey($tableName, $columns, $constraint); |
|
| 352 | $end(); |
|
| 353 | } |
|
| 354 | ||
| 355 | /** |
|
| 356 | * {@inheritdoc} |
|