* Remove deprecated analytics role * Make anchor tag a bit more readable * Add OrganizationMembership table and model * Add organization_membership associations * Add unique indices for user_id and org_id * Wrap update and create calls in transactions * Remove specs of deprecated analytics_beta_tester
13 lines
414 B
Ruby
13 lines
414 B
Ruby
class CreateOrganizationMemberships < ActiveRecord::Migration[5.2]
|
|
def change
|
|
create_table :organization_memberships do |t|
|
|
t.bigint :user_id, null: false
|
|
t.bigint :organization_id, null: false
|
|
t.string :user_title
|
|
t.string :type_of_user, null: false
|
|
t.timestamps null: false
|
|
end
|
|
|
|
add_index :organization_memberships, %i[user_id organization_id], unique: true
|
|
end
|
|
end
|