| @@ 263-291 (lines=29) @@ | ||
| 260 | */ |
|
| 261 | public function migrated(MigrationInterface $migration, $direction, $startTime, $endTime) |
|
| 262 | { |
|
| 263 | if (strcasecmp($direction, MigrationInterface::UP) === 0) { |
|
| 264 | // up |
|
| 265 | $sql = sprintf( |
|
| 266 | "INSERT INTO %s (%s, %s, %s, %s, %s) VALUES ('%s', '%s', '%s', '%s', %s);", |
|
| 267 | $this->getSchemaTableName(), |
|
| 268 | $this->quoteColumnName('version'), |
|
| 269 | $this->quoteColumnName('migration_name'), |
|
| 270 | $this->quoteColumnName('start_time'), |
|
| 271 | $this->quoteColumnName('end_time'), |
|
| 272 | $this->quoteColumnName('breakpoint'), |
|
| 273 | $migration->getVersion(), |
|
| 274 | substr($migration->getName(), 0, 100), |
|
| 275 | $startTime, |
|
| 276 | $endTime, |
|
| 277 | $this->castToBool(false) |
|
| 278 | ); |
|
| 279 | ||
| 280 | $this->execute($sql); |
|
| 281 | } else { |
|
| 282 | // down |
|
| 283 | $sql = sprintf( |
|
| 284 | "DELETE FROM %s WHERE %s = '%s'", |
|
| 285 | $this->getSchemaTableName(), |
|
| 286 | $this->quoteColumnName('version'), |
|
| 287 | $migration->getVersion() |
|
| 288 | ); |
|
| 289 | ||
| 290 | $this->execute($sql); |
|
| 291 | } |
|
| 292 | ||
| 293 | return $this; |
|
| 294 | } |
|
| @@ 991-1019 (lines=29) @@ | ||
| 988 | $startTime = "TO_TIMESTAMP('$startTime', 'YYYY-MM-DD HH24:MI:SS')"; |
|
| 989 | $endTime = "TO_TIMESTAMP('$endTime', 'YYYY-MM-DD HH24:MI:SS')"; |
|
| 990 | ||
| 991 | if (strcasecmp($direction, MigrationInterface::UP) === 0) { |
|
| 992 | // up |
|
| 993 | $sql = sprintf( |
|
| 994 | "INSERT INTO \"%s\" (%s, %s, %s, %s, %s) VALUES ('%s', '%s', %s, %s, %s)", |
|
| 995 | $this->getSchemaTableName(), |
|
| 996 | $this->quoteColumnName('version'), |
|
| 997 | $this->quoteColumnName('migration_name'), |
|
| 998 | $this->quoteColumnName('start_time'), |
|
| 999 | $this->quoteColumnName('end_time'), |
|
| 1000 | $this->quoteColumnName('breakpoint'), |
|
| 1001 | $migration->getVersion(), |
|
| 1002 | substr($migration->getName(), 0, 100), |
|
| 1003 | $startTime, |
|
| 1004 | $endTime, |
|
| 1005 | $this->castToBool(false) |
|
| 1006 | ); |
|
| 1007 | ||
| 1008 | $this->execute($sql); |
|
| 1009 | } else { |
|
| 1010 | // down |
|
| 1011 | $sql = sprintf( |
|
| 1012 | "DELETE FROM \"%s\" WHERE %s = '%s'", |
|
| 1013 | $this->getSchemaTableName(), |
|
| 1014 | $this->quoteColumnName('version'), |
|
| 1015 | $migration->getVersion() |
|
| 1016 | ); |
|
| 1017 | ||
| 1018 | $this->execute($sql); |
|
| 1019 | } |
|
| 1020 | ||
| 1021 | return $this; |
|
| 1022 | } |
|