Customize migration execution order to do it in milestone order

Once Add a method to note what milestone a migration... (#414013 - closed) is complete, we should have the associated milestone information on a given migration. With this, we need to patch how rails orders migrations so they can be run in milestone order.

Deliverable

  • A method is added to the migration class specifying milestone
  • rails db:migrate executes migrations for each milestone in order. Ex: 16.0 regular -> 16.0 post -> 16.1 regular -> 16.1 post -> ect
  • Migrations without a specified milestone run first
  • If SKIP_POST_DEPLOYMENT_MIGRATIONS is true
    • Retain current behavior of skipping post deployment migrations.

Testing

See #414014 (comment 1866528615) for details on the testing done.

Edited by Krasimir Angelov