1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00
mastodon/db/migrate/20240801094244_populate_everyone_role.rb
2024-08-01 13:16:03 +02:00

21 lines
428 B
Ruby

# frozen_string_literal: true
class PopulateEveryoneRole < ActiveRecord::Migration[7.1]
disable_ddl_transaction!
class UserRole < ApplicationRecord
EVERYONE_ROLE_ID = -99
FLAGS = {
invite_users: (1 << 16),
}.freeze
end
def up
UserRole.create!(id: UserRole::EVERYONE_ROLE_ID, permissions: UserRole::FLAGS[:invite_users])
rescue ActiveRecord::RecordNotUnique
nil
end
def down; end
end