Describe the bug
When installing migrations on a new app, you get this warning.
NOTE: Migration 20171109132011_enable_pg_extensions.rb from decidim_initiatives has been skipped. Migration with the same name already exists
Indeed, there are two migrations with the same name (that also do the same thing):
$ fd enable_pg_extensions
decidim-initiatives/db/migrate/20171109132011_enable_pg_extensions.rb
decidim-proposals/db/migrate/20171212102250_enable_pg_extensions.rb
# frozen_string_literal: true
class EnablePgExtensions < ActiveRecord::Migration[5.1]
def change
enable_extension "pg_trgm"
rescue ActiveRecord::CatchAll => e
logger.error "Can not deal with pg_trgm extension: #{e}"
end
end
# frozen_string_literal: true
class EnablePgExtensions < ActiveRecord::Migration[5.1]
def change
return if extension_enabled?("pg_trgm")
begin
# required so that test suite works in ci env
enable_extension "pg_trgm"
rescue StandardError
raise <<-MSG.squish
Decidim requires the pg_trgm extension to be enabled in your PostgreSQL.
You can do so by running `CREATE EXTENSION IF NOT EXISTS "pg_trgm";` on the current DB as a PostgreSQL
super user.
MSG
end
end
end
This is unlikely to cause problems, but I guess we should probably either:
To Reproduce
bundle exec rake development_appExpected behavior
No warnings when installing decidim migrations.
Screenshots
_None_.
Stacktrace
_None_.
Extra data (please complete the following information):
I'd rename the migrations, then. While it's true we consider decidim as a bundle, and as such you'll always have both migrations, this extension is a dependency of each component, so I think each component should be aware of it.
Thoughts @decidim/developers ?
Most helpful comment
I'd rename the migrations, then. While it's true we consider decidim as a bundle, and as such you'll always have both migrations, this extension is a dependency of each component, so I think each component should be aware of it.
Thoughts @decidim/developers ?