| @@ 235-256 (lines=22) @@ | ||
| 232 | /** |
|
| 233 | * {@inheritdoc} |
|
| 234 | */ |
|
| 235 | public function getVersionLog() |
|
| 236 | { |
|
| 237 | $result = []; |
|
| 238 | ||
| 239 | switch ($this->options['version_order']) { |
|
| 240 | case \Phinx\Config\Config::VERSION_ORDER_CREATION_TIME: |
|
| 241 | $orderBy = 'version ASC'; |
|
| 242 | break; |
|
| 243 | case \Phinx\Config\Config::VERSION_ORDER_EXECUTION_TIME: |
|
| 244 | $orderBy = 'start_time ASC, version ASC'; |
|
| 245 | break; |
|
| 246 | default: |
|
| 247 | throw new \RuntimeException('Invalid version_order configuration option'); |
|
| 248 | } |
|
| 249 | ||
| 250 | $rows = $this->fetchAll(sprintf('SELECT * FROM %s ORDER BY %s', $this->getSchemaTableName(), $orderBy)); |
|
| 251 | foreach ($rows as $version) { |
|
| 252 | $result[$version['version']] = $version; |
|
| 253 | } |
|
| 254 | ||
| 255 | return $result; |
|
| 256 | } |
|
| 257 | ||
| 258 | /** |
|
| 259 | * {@inheritdoc} |
|
| @@ 1088-1110 (lines=23) @@ | ||
| 1085 | /** |
|
| 1086 | * {@inheritdoc} |
|
| 1087 | */ |
|
| 1088 | public function getVersionLog() |
|
| 1089 | { |
|
| 1090 | $result = []; |
|
| 1091 | ||
| 1092 | switch ($this->options['version_order']) { |
|
| 1093 | case \Phinx\Config\Config::VERSION_ORDER_CREATION_TIME: |
|
| 1094 | $orderBy = '"version" ASC'; |
|
| 1095 | break; |
|
| 1096 | case \Phinx\Config\Config::VERSION_ORDER_EXECUTION_TIME: |
|
| 1097 | $orderBy = '"start_time" ASC, "version" ASC'; |
|
| 1098 | break; |
|
| 1099 | default: |
|
| 1100 | throw new \RuntimeException('Invalid version_order configuration option'); |
|
| 1101 | } |
|
| 1102 | ||
| 1103 | $rows = $this->fetchAll(sprintf('SELECT * FROM %s ORDER BY %s', $this->quoteColumnName( |
|
| 1104 | $this->getSchemaTableName() |
|
| 1105 | ), $orderBy)); |
|
| 1106 | foreach ($rows as $version) { |
|
| 1107 | $result[$version['version']] = $version; |
|
| 1108 | } |
|
| 1109 | ||
| 1110 | return $result; |
|
| 1111 | } |
|
| 1112 | } |
|
| 1113 | ||