Sha256: 0beb7c9ea1fff94f6646452faa0c5e5657fd0151c063958c25fd3265d2d8ca0b

Contents?: true

Size: 1008 Bytes

Versions: 1

Compression:

Stored size: 1008 Bytes

Contents

# frozen_string_literal: true

class AddDeviseInvitableToEacUsersSupportUsers < (
    Rails.version < '5' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
  )
  def up # rubocop:disable Metrics/MethodLength
    change_table :eac_users_support_users 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      :invitations_count
      t.index      :invitation_token, unique: true # for invitable
      t.index      :invited_by_id
    end
  end

  def down
    change_table :eac_users_support_users 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

1 entries across 1 versions & 1 rubygems

Version Path
eac_users_support-0.11.1 db/migrate/20200322051231_add_devise_invitable_to_eac_users_support_users.rb