| @@ 186-203 (lines=18) @@ | ||
| 183 | /** |
|
| 184 | * {@inheritdoc} |
|
| 185 | */ |
|
| 186 | public function addColumn(Table $table, Column $column) |
|
| 187 | { |
|
| 188 | $adapter = $this->getAdapter(); |
|
| 189 | if (!$adapter instanceof DirectActionInterface) { |
|
| 190 | throw new \BadMethodCallException('The adapter needs to implement DirectActionInterface'); |
|
| 191 | } |
|
| 192 | $end = $this->startCommandTimer(); |
|
| 193 | $this->writeCommand( |
|
| 194 | 'addColumn', |
|
| 195 | [ |
|
| 196 | $table->getName(), |
|
| 197 | $column->getName(), |
|
| 198 | $column->getType() |
|
| 199 | ] |
|
| 200 | ); |
|
| 201 | $adapter->addColumn($table, $column); |
|
| 202 | $end(); |
|
| 203 | } |
|
| 204 | ||
| 205 | /** |
|
| 206 | * {@inheritdoc} |
|
| @@ 223-233 (lines=11) @@ | ||
| 220 | /** |
|
| 221 | * {@inheritdoc} |
|
| 222 | */ |
|
| 223 | public function changeColumn($tableName, $columnName, Column $newColumn) |
|
| 224 | { |
|
| 225 | $adapter = $this->getAdapter(); |
|
| 226 | if (!$adapter instanceof DirectActionInterface) { |
|
| 227 | throw new \BadMethodCallException('The adapter needs to implement DirectActionInterface'); |
|
| 228 | } |
|
| 229 | $end = $this->startCommandTimer(); |
|
| 230 | $this->writeCommand('changeColumn', [$tableName, $columnName, $newColumn->getType()]); |
|
| 231 | $adapter->changeColumn($tableName, $columnName, $newColumn); |
|
| 232 | $end(); |
|
| 233 | } |
|
| 234 | ||
| 235 | /** |
|
| 236 | * {@inheritdoc} |
|
| @@ 253-263 (lines=11) @@ | ||
| 250 | /** |
|
| 251 | * {@inheritdoc} |
|
| 252 | */ |
|
| 253 | public function addIndex(Table $table, Index $index) |
|
| 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('addIndex', [$table->getName(), $index->getColumns()]); |
|
| 261 | $adapter->addIndex($table, $index); |
|
| 262 | $end(); |
|
| 263 | } |
|
| 264 | ||
| 265 | /** |
|
| 266 | * {@inheritdoc} |
|
| @@ 298-308 (lines=11) @@ | ||
| 295 | /** |
|
| 296 | * {@inheritdoc} |
|
| 297 | */ |
|
| 298 | public function addForeignKey(Table $table, ForeignKey $foreignKey) |
|
| 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('addForeignKey', [$table->getName(), $foreignKey->getColumns()]); |
|
| 306 | $adapter->addForeignKey($table, $foreignKey); |
|
| 307 | $end(); |
|
| 308 | } |
|
| 309 | ||
| 310 | /** |
|
| 311 | * {@inheritdoc} |
|