Skip to content
Snippets Groups Projects
Commit f54dca06 authored by René Klačan's avatar René Klačan Committed by Eugen Rochko
Browse files

Add migration versions (#3574)

Since Rails 5.1 missing migration version results in following error:

```
StandardError: Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for:
```

This PR fixes all migration files.
parent 370fa709
Branches
Tags
No related merge requests found
MIGRATION_BASE_CLASS = if ActiveRecord::VERSION::MAJOR >= 5
ActiveRecord::Migration[5.0]
else
ActiveRecord::Migration
ActiveRecord::Migration[4.2]
end
class RailsSettingsMigration < MIGRATION_BASE_CLASS
......
class MigrateSettings < ActiveRecord::Migration
class MigrateSettings < ActiveRecord::Migration[4.2]
def up
remove_index :settings, [:target_type, :target_id, :var]
rename_column :settings, :target_id, :thing_id
......
class AddAttachmentDataToImports < ActiveRecord::Migration
class AddAttachmentDataToImports < ActiveRecord::Migration[4.2]
def self.up
change_table :imports do |t|
t.attachment :data
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment