From 94345ddc3ac37ca2ec79072f71daa1a8b942d72a Mon Sep 17 00:00:00 2001 From: Jakub Kottnauer Date: Mon, 20 May 2024 17:33:19 +0200 Subject: [PATCH] Add migration to make all current users admins (#770) --- db/migrate/20240520074309_add_admin_role_to_current_users.rb | 5 +++++ db/schema.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20240520074309_add_admin_role_to_current_users.rb diff --git a/db/migrate/20240520074309_add_admin_role_to_current_users.rb b/db/migrate/20240520074309_add_admin_role_to_current_users.rb new file mode 100644 index 00000000..9dcdd67d --- /dev/null +++ b/db/migrate/20240520074309_add_admin_role_to_current_users.rb @@ -0,0 +1,5 @@ +class AddAdminRoleToCurrentUsers < ActiveRecord::Migration[7.2] + def up + User.update_all(role: "admin") + end +end diff --git a/db/schema.rb b/db/schema.rb index 75a4c530..f7273e3b 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[7.2].define(version: 2024_05_02_205006) do +ActiveRecord::Schema[7.2].define(version: 2024_05_20_074309) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" enable_extension "plpgsql"