Sha256: 01e1861f22e53e38600efd627330bd74da5454f3f28703b2341c05c95b19bfa1

Contents?: true

Size: 855 Bytes

Versions: 9

Compression:

Stored size: 855 Bytes

Contents

require 'rails/generators/active_record'

module Doorkeeper
  module OpenidConnect
    class MigrationGenerator < ::Rails::Generators::Base
      include ::Rails::Generators::Migration
      source_root File.expand_path('../templates', __FILE__)
      desc 'Installs Doorkeeper OpenID Connect migration file.'

      def install
        migration_template(
          'migration.rb.erb',
          'db/migrate/create_doorkeeper_openid_connect_tables.rb',
          migration_version: migration_version
        )
      end

      def self.next_migration_number(dirname)
        ActiveRecord::Generators::Base.next_migration_number(dirname)
      end

      private

      def migration_version
        if ActiveRecord::VERSION::MAJOR >= 5
          "[#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}]"
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
doorkeeper-openid_connect-1.7.1 lib/generators/doorkeeper/openid_connect/migration_generator.rb
doorkeeper-openid_connect-1.7.0 lib/generators/doorkeeper/openid_connect/migration_generator.rb
doorkeeper-openid_connect-1.6.3 lib/generators/doorkeeper/openid_connect/migration_generator.rb
doorkeeper-openid_connect-1.6.2 lib/generators/doorkeeper/openid_connect/migration_generator.rb
doorkeeper-openid_connect-1.6.1 lib/generators/doorkeeper/openid_connect/migration_generator.rb
doorkeeper-openid_connect-1.6.0 lib/generators/doorkeeper/openid_connect/migration_generator.rb
doorkeeper-openid_connect-1.5.5 lib/generators/doorkeeper/openid_connect/migration_generator.rb
doorkeeper-openid_connect-1.5.4 lib/generators/doorkeeper/openid_connect/migration_generator.rb
doorkeeper-openid_connect-1.5.3 lib/generators/doorkeeper/openid_connect/migration_generator.rb