diff --git a/lib/stitches/generator_files/db/migrate/add_enabled_to_api_clients.rb b/lib/stitches/generator_files/db/migrate/add_enabled_to_api_clients.rb index 5388ad5..b1a323b 100644 --- a/lib/stitches/generator_files/db/migrate/add_enabled_to_api_clients.rb +++ b/lib/stitches/generator_files/db/migrate/add_enabled_to_api_clients.rb @@ -1,4 +1,8 @@ +<% if Rails::VERSION::MAJOR >= 5 %> +class AddEnabledToApiClients < ActiveRecord::Migration[<%= Rails::VERSION::MAJOR %>.<%= Rails::VERSION::MINOR %>] +<% else %> class AddEnabledToApiClients < ActiveRecord::Migration +<% end %> def change add_column :api_clients, :enabled, :bool, null: false, default: true remove_index :api_clients, [:name ] # existing one would be unique diff --git a/lib/stitches/generator_files/db/migrate/create_api_clients.rb b/lib/stitches/generator_files/db/migrate/create_api_clients.rb index e94ab51..7756103 100644 --- a/lib/stitches/generator_files/db/migrate/create_api_clients.rb +++ b/lib/stitches/generator_files/db/migrate/create_api_clients.rb @@ -1,4 +1,8 @@ +<% if Rails::VERSION::MAJOR >= 5 %> +class CreateApiClients < ActiveRecord::Migration[<%= Rails::VERSION::MAJOR %>.<%= Rails::VERSION::MINOR %>] +<% else %> class CreateApiClients < ActiveRecord::Migration +<% end %> def change create_table :api_clients do |t| t.string :name, null: false diff --git a/lib/stitches/generator_files/db/migrate/enable_uuid_ossp_extension.rb b/lib/stitches/generator_files/db/migrate/enable_uuid_ossp_extension.rb index e5d5bd9..4f8d922 100644 --- a/lib/stitches/generator_files/db/migrate/enable_uuid_ossp_extension.rb +++ b/lib/stitches/generator_files/db/migrate/enable_uuid_ossp_extension.rb @@ -1,4 +1,8 @@ +<% if Rails::VERSION::MAJOR >= 5 %> +class EnableUuidOsspExtension < ActiveRecord::Migration[<%= Rails::VERSION::MAJOR %>.<%= Rails::VERSION::MINOR %>] +<% else %> class EnableUuidOsspExtension < ActiveRecord::Migration +<% end %> def change enable_extension 'uuid-ossp' end