mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-25 01:24:02 -05:00
11 lines
350 B
Ruby
11 lines
350 B
Ruby
# frozen_string_literal: true
|
|
|
|
class AddRoleIdToUsers < ActiveRecord::Migration[6.1]
|
|
disable_ddl_transaction!
|
|
|
|
def change
|
|
safety_assured { add_reference :users, :role, foreign_key: { to_table: 'user_roles', on_delete: :nullify }, index: false }
|
|
add_index :users, :role_id, algorithm: :concurrently, where: 'role_id IS NOT NULL'
|
|
end
|
|
end
|