diff options
author | Matthew Lemon <y@yulqen.org> | 2024-11-11 21:09:06 +0000 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-11-11 21:09:06 +0000 |
commit | 634cf4ee06a4820eaa2431a272b9a223118cf884 (patch) | |
tree | 2e49854aa28062c9c68fdbe0e554459469098d61 /db | |
parent | b4acbcadc7b4f73efe0580be2dd3cf1dbe342682 (diff) |
Adds is_admin to the User model and ensures only admin users can add new resource
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20241111204736_add_is_admin_to_user.rb | 5 | ||||
-rw-r--r-- | db/schema.rb | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/db/migrate/20241111204736_add_is_admin_to_user.rb b/db/migrate/20241111204736_add_is_admin_to_user.rb new file mode 100644 index 0000000..a055513 --- /dev/null +++ b/db/migrate/20241111204736_add_is_admin_to_user.rb @@ -0,0 +1,5 @@ +class AddIsAdminToUser < ActiveRecord::Migration[8.0] + def change + add_column :users, :is_admin, :boolean, default: false + end +end diff --git a/db/schema.rb b/db/schema.rb index 96d2113..1977b3f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[8.0].define(version: 2024_11_11_162806) do +ActiveRecord::Schema[8.0].define(version: 2024_11_11_204736) do create_table "active_storage_attachments", force: :cascade do |t| t.string "name", null: false t.string "record_type", null: false @@ -68,6 +68,7 @@ ActiveRecord::Schema[8.0].define(version: 2024_11_11_162806) do t.string "password_digest", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.boolean "is_admin", default: false t.index ["email_address"], name: "index_users_on_email_address", unique: true end |