Skip to content

armgit / maybe

Public Imported from GitHub
0

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.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"