Skip to content

Commit

Permalink
fix table_exists? on SchemaMigration
Browse files Browse the repository at this point in the history
- after rails upgrade this now appears to be an instance method
  • Loading branch information
asmega committed Nov 21, 2024
1 parent e946aab commit 02ee408
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/tasks/default.rake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ db_namespace = namespace(:db) {
task setup_or_migrate: :load_config do
ActiveRecord::Base.configurations.configs_for(env_name: Rails.env).each do |db_config|
ActiveRecord::Base.establish_connection(db_config.configuration_hash)
if ActiveRecord::SchemaMigration.table_exists?

connection = ActiveRecord::Base.connection
schema_migration = ActiveRecord::SchemaMigration.new(connection)

if schema_migration.table_exists?
db_namespace["migrate"].invoke
else
db_namespace["setup"].invoke
Expand Down

0 comments on commit 02ee408

Please sign in to comment.