Move db:migrate:status to DatabaseTasks method #34081
Conversation
d476858
to
ee071d8
Hi @gmcgibbon ! Nice refactor! Thanks! |
@@ -812,6 +814,34 @@ def capture_migration_output | |||
end | |||
end | |||
end | |||
|
|||
class DatabaseTasksMigrateStatusTest < DatabaseTasksMigrationTestCase | |||
test "migrate status table" do |
albertoalmagro
Oct 4, 2018
Contributor
I know this varies from file to file, but I think it is better to maintain the same style as in the other tests, at least in the same file, I would therefore declare this as:
def test_migrate_status_table
The same applies to:
def migrate_status_table_without_migrations_table
I know this varies from file to file, but I think it is better to maintain the same style as in the other tests, at least in the same file, I would therefore declare this as:
def test_migrate_status_table
The same applies to:
def migrate_status_table_without_migrations_table
gmcgibbon
Oct 5, 2018
Author
Member
My mistake, I noticed they were using setup do..end
and teardown do..end
, so I assumed they were also using test "desc" do..end
as well. Thanks for pointing that out 👍
My mistake, I noticed they were using setup do..end
and teardown do..end
, so I assumed they were also using test "desc" do..end
as well. Thanks for pointing that out
864aac2
to
e92abaf
Thanks for changing this! |
I'm not sure if it's failed before in the same way or whether this failure is new, but SQLite3 on 2.5.1 is failing with "Schema migrations table does not exist yet." https://travis-ci.org/rails/rails/jobs/437454850 Otherwise this looks good |
@albertoalmagro Yes, I removed it because there was already test coverage for @eileencodes Sorry, it seems on CI the migrations table doesn't get created automatically whereas locally it does. Invoking the functions to create and drop the migrations table seemed to work last CI run so I'll try that again. |
96bc4d0
to
b04f062
Build is already OK, one job's build seems to be stalled. +1! Thanks |
Sorry I missed the changelog entry before. Can you remove it and then I'll merge. |
@@ -1,3 +1,7 @@ | |||
* Move `db:migrate:status` code to `ActiveRecord::Tasks::DatabaseTasks.migrate_status`. | |||
|
|||
*Gannon McGibbon* |
eileencodes
Oct 7, 2018
Member
Can you remove this changleog entry? I don't think it's necessary (rake task acts the same) and I think this may make users think that they can't use db:migrate:status
anymore.
Can you remove this changleog entry? I don't think it's necessary (rake task acts the same) and I think this may make users think that they can't use db:migrate:status
anymore.
gmcgibbon
Oct 8, 2018
Author
Member
👍 Removed!
b04f062
to
0d435c1
|
Summary
Move
db:migrate:status
code toActiveRecord::Tasks::DatabaseTasks
method. I've also changed theabort
call to an actual exception. This made multi-db statuses easier to implement so I'm PR-ing this first. We gain some test coverage for migration status too!r? @eileencodes
/cc @rafaelfranca