Sha256: 9f86baef92c48a863ab960e7e56a824a9037c26054e857c74bac6d652f596bbd
Contents?: true
Size: 936 Bytes
Versions: 7
Compression:
Stored size: 936 Bytes
Contents
class PersonaDeviseInvitableAddToUsers < ActiveRecord::Migration[5.2] def up unless ActiveRecord::Base.connection.column_exists?(:users, :invitation_token) change_table :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 end def down change_table :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
7 entries across 7 versions & 1 rubygems