main
rb 12 lines 573 Bytes
Raw
1 # frozen_string_literal: true
2
3 # Grants the admin console. Admins reach /admin — the internal ops/business
4 # dashboard for siGit (users, repositories, subscriptions, cloud usage). This is
5 # staff access, not a customer-facing role, so it defaults to false and is
6 # toggled by hand (rake admin:grant or another admin in the console).
7 class AddAdminToUsers < ActiveRecord::Migration[8.1]
8 def change
9 add_column :users, :admin, :boolean, null: false, default: false
10 add_index :users, :admin, where: "admin = true", name: "index_users_on_admin_when_true"
11 end
12 end