Class: CreateUserPermissions

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/oxen_user/templates/user_permission.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
12
13
# File 'lib/generators/oxen_user/templates/user_permission.rb', line 2

def change
  create_table :user_permissions do |t|
    t.references :account, index: true
    t.references :user, index: true
    t.string :email
    t.string :permissions

    t.timestamps null: false
  end
  add_foreign_key :user_permissions, :accounts
  add_foreign_key :user_permissions, :users
end