Remove obsolete `admin` and `moderator` columns from `users` table (#29718)

This commit is contained in:
Claire 2024-03-22 17:22:36 +01:00 committed by GitHub
parent d71d26a3c9
commit 58376eedda
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 5 deletions

View File

@ -14,7 +14,6 @@
# sign_in_count :integer default(0), not null
# current_sign_in_at :datetime
# last_sign_in_at :datetime
# admin :boolean default(FALSE), not null
# confirmation_token :string
# confirmed_at :datetime
# confirmation_sent_at :datetime
@ -29,7 +28,6 @@
# otp_backup_codes :string is an Array
# account_id :bigint(8) not null
# disabled :boolean default(FALSE), not null
# moderator :boolean default(FALSE), not null
# invite_id :bigint(8)
# chosen_languages :string is an Array
# created_by_application_id :bigint(8)

View File

@ -0,0 +1,8 @@
# frozen_string_literal: true
class RemoveObsoleteRolesFromUsers < ActiveRecord::Migration[7.1]
def change
safety_assured { remove_column :users, :admin, :boolean, default: false, null: false }
safety_assured { remove_column :users, :moderator, :boolean, default: false, null: false }
end
end

View File

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.1].define(version: 2024_03_22_130318) do
ActiveRecord::Schema[7.1].define(version: 2024_03_22_161611) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -1170,7 +1170,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_03_22_130318) do
t.integer "sign_in_count", default: 0, null: false
t.datetime "current_sign_in_at", precision: nil
t.datetime "last_sign_in_at", precision: nil
t.boolean "admin", default: false, null: false
t.string "confirmation_token"
t.datetime "confirmed_at", precision: nil
t.datetime "confirmation_sent_at", precision: nil
@ -1185,7 +1184,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_03_22_130318) do
t.string "otp_backup_codes", array: true
t.bigint "account_id", null: false
t.boolean "disabled", default: false, null: false
t.boolean "moderator", default: false, null: false
t.bigint "invite_id"
t.string "chosen_languages", array: true
t.bigint "created_by_application_id"