Sha256: caf2fd5b416b3d66d5fff7a76e41c1dcd1040fcb90cb6e7f62706ca0ad97c7e4

Contents?: true

Size: 658 Bytes

Versions: 25

Compression:

Stored size: 658 Bytes

Contents

# frozen_string_literal: true

class EnablePolymorphicResourceOwner < ActiveRecord::Migration<%= migration_version %>
  def change
    add_column :oauth_access_tokens, :resource_owner_type, :string
    add_column :oauth_access_grants, :resource_owner_type, :string
    change_column_null :oauth_access_grants, :resource_owner_type, false

    add_index :oauth_access_tokens,
              [:resource_owner_id, :resource_owner_type],
              name: 'polymorphic_owner_oauth_access_tokens'

    add_index :oauth_access_grants,
              [:resource_owner_id, :resource_owner_type],
              name: 'polymorphic_owner_oauth_access_grants'
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
doorkeeper-5.5.0.rc2 lib/generators/doorkeeper/templates/enable_polymorphic_resource_owner_migration.rb.erb
doorkeeper-5.5.0.rc1 lib/generators/doorkeeper/templates/enable_polymorphic_resource_owner_migration.rb.erb
doorkeeper-5.4.0 lib/generators/doorkeeper/templates/enable_polymorphic_resource_owner_migration.rb.erb
doorkeeper-5.4.0.rc2 lib/generators/doorkeeper/templates/enable_polymorphic_resource_owner_migration.rb.erb
doorkeeper-5.4.0.rc1 lib/generators/doorkeeper/templates/enable_polymorphic_resource_owner_migration.rb.erb