The personal finance app for everyone
Add migration to make all current users admins (#770)
Jakub Kottnauer94345ddc3ac3
diff --git a/db/migrate/20240520074309_add_admin_role_to_current_users.rb b/db/migrate/20240520074309_add_admin_role_to_current_users.rbnew file mode 100644index 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+enddiff --git a/db/schema.rb b/db/schema.rbindex 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 databaseenable_extension "pgcrypto"enable_extension "plpgsql"