Sha256: 7db283944d2786c0ce7126ef35e0c21d620ad766aed776a35befcac0284b7139
Contents?: true
Size: 833 Bytes
Versions: 11
Compression:
Stored size: 833 Bytes
Contents
class CreateSocialiteIdentities < ActiveRecord::Migration def up create_table :<%= options[:identity_table] %> do |t| t.string :uid, :provider t.text :auth_hash t.integer :<%= "#{options[:users_table].singularize}_id" %> t.timestamps end add_index :<%= options[:identity_table] %>, :<%= "#{options[:users_table].singularize}_id" %> # Restrict each user to one identity per provider, to disable comment out. add_index :<%= options[:identity_table] %>, [:<%= "#{options[:users_table].singularize}_id" %>, :provider], :unique => true # Database constraint to ensure uniqueness of UIDs (scoped to provider) add_index :<%= options[:identity_table] %>, [:provider, :uid], :unique => true end def down drop_table :<%= options[:identity_table] %> end end
Version data entries
11 entries across 11 versions & 1 rubygems