Sha256: 7709c03ff1635b2056df983a20d6bc091f5e711df79923aa708d0d727ab4e287

Contents?: true

Size: 840 Bytes

Versions: 8

Compression:

Stored size: 840 Bytes

Contents

class DeviseInvitableAddTo<%= table_name.camelize %> < ActiveRecord::Migration<%= migration_version %>
  def up
    change_table :<%= table_name %> do |t|
      t.string     :invitation_token
      t.datetime   :invitation_created_at
      t.datetime   :invitation_sent_at
      t.datetime   :invitation_accepted_at
      t.integer    :invitation_limit
      t.references :invited_by, polymorphic: true
      t.integer    :invitations_count, default: 0
      t.index      :invitation_token, unique: true # for invitable
      t.index      :invited_by_id
    end
  end

  def down
    change_table :<%= table_name %> do |t|
      t.remove_references :invited_by, polymorphic: true
      t.remove :invitations_count, :invitation_limit, :invitation_sent_at, :invitation_accepted_at, :invitation_token, :invitation_created_at
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/devise_invitable-2.0.9/lib/generators/active_record/templates/migration.rb
devise_invitable-2.0.9 lib/generators/active_record/templates/migration.rb
devise_invitable-2.0.8 lib/generators/active_record/templates/migration.rb
devise_invitable-2.0.7 lib/generators/active_record/templates/migration.rb
devise_invitable-2.0.6 lib/generators/active_record/templates/migration.rb
devise_invitable-2.0.5 lib/generators/active_record/templates/migration.rb
devise_invitable-2.0.4 lib/generators/active_record/templates/migration.rb
devise_invitable-2.0.3 lib/generators/active_record/templates/migration.rb