phinx icon indicating copy to clipboard operation
phinx copied to clipboard

phinx status prints down migrations out of order

Open MasterOdin opened this issue 4 years ago • 2 comments

Adding a migration to a list of existing migrations, where its id falls between existing ones, I get:

$ bin/phinx status
Phinx by CakePHP - https://phinx.org.

using config file ./phinx.yml
using config parser yml
using migration paths
 - /Users/mpeveler/Work/Github/phinx/db/migrations
using seed paths
warning no environment specified, defaulting to: mysql
ordering by creation time

 Status  [Migration ID]  Started              Finished             Migration Name
----------------------------------------------------------------------------------
     up  20190928205056  2020-04-11 16:07:50  2020-04-11 16:07:50  Migration
     up  20200411164726  2020-04-11 16:47:59  2020-04-11 16:47:59  ThirdMigration
   down  20200411160806                                            SecondMigration

I would expect the SecondMigration to be in the middle of the two, given its id and after migrating, I get:

$ bin/phinx status
Phinx by CakePHP - https://phinx.org.

using config file ./phinx.yml
using config parser yml
using migration paths
 - /Users/mpeveler/Work/Github/phinx/db/migrations
using seed paths
warning no environment specified, defaulting to: mysql
ordering by creation time

 Status  [Migration ID]  Started              Finished             Migration Name
----------------------------------------------------------------------------------
     up  20190928205056  2020-04-11 16:07:50  2020-04-11 16:07:50  Migration
     up  20200411160806  2020-04-11 16:50:54  2020-04-11 16:50:54  SecondMigration
     up  20200411164726  2020-04-11 16:50:47  2020-04-11 16:50:47  ThirdMigration

MasterOdin avatar Apr 11 '20 16:04 MasterOdin

@MasterOdin Looks like it orders by status then by Migration Id which kind of makes sense

JRDuncan avatar Oct 21 '20 15:10 JRDuncan

I cannot confirm that though in current master:

     up  20201009214656  MigrationInit       
   down  20201009214657  MigrationInit2      
     up  20201014000218  MigrationLanguages  
     up  20201014000219  MigrationContinents 
     up  20201014000220  MigrationCountries  
     up  20201014000221  MigrationCities   

They seem to always be displayed by timestamp. Maybe that is migrations plugin converting that already or resorting ( https://github.com/cakephp/migrations ). But I think this is probably the most useful display, as it shows in colors anyway, so the order helps to just know about possible conflicts.

dereuromark avatar Oct 24 '20 12:10 dereuromark