We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 39fdaa7 + 57d835f commit c61eeeeCopy full SHA for c61eeee
db/migrate/20230421202218_fix_bad_user_roles.rb
@@ -0,0 +1,10 @@
1
+class FixBadUserRoles < ActiveRecord::Migration[7.0]
2
+ def change
3
+ bad_roles = Role.all.select { |r| r.resource_type && r.resource.nil? }
4
+
5
+ bad_roles.each do |role|
6
+ UsersRole.where(role_id: role.id).destroy_all
7
+ role.destroy
8
+ end
9
10
+end
db/schema.rb
@@ -10,7 +10,7 @@
#
11
# It's strongly recommended that you check this file into your version control system.
12
13
-ActiveRecord::Schema[7.0].define(version: 2023_03_16_135543) do
+ActiveRecord::Schema[7.0].define(version: 2023_04_21_202218) do
14
# These are extensions that must be enabled in order to support this database
15
enable_extension "plpgsql"
16
0 commit comments