DEV: Deprecate defunct User#flag_level column (#24134)

The User#flag_level column has not been in use for a very long time. The "new" reviewable system dynamically calculates flag scores based on past performance of the user.

This PR removes flag_level from the admin user serializer (since it isn't displayed anywhere in admin user lists) and marks the column as deprecated and targeted for removal in the next minor version.
This commit is contained in:
Ted Johansson 2023-10-27 17:27:04 +08:00 committed by GitHub
parent b6f9bc556e
commit 3f3d2ee2c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 3 additions and 9 deletions

View File

@ -6,6 +6,7 @@ class User < ActiveRecord::Base
include HasCustomFields
include SecondFactorManager
include HasDestroyedWebHook
include HasDeprecatedColumns
DEFAULT_FEATURED_BADGE_COUNT = 3
@ -13,6 +14,8 @@ class User < ActiveRecord::Base
TARGET_PASSWORD_ALGORITHM =
"$pbkdf2-#{Rails.configuration.pbkdf2_algorithm}$i=#{Rails.configuration.pbkdf2_iterations},l=32$"
deprecate_column :flag_level, drop_from: "3.2"
# not deleted on user delete
has_many :posts
has_many :topics

View File

@ -14,7 +14,6 @@ class AdminUserListSerializer < BasicUserSerializer
:created_at_age,
:trust_level,
:manual_locked_trust_level,
:flag_level,
:username,
:title,
:avatar_template,

View File

@ -65,9 +65,6 @@
"null"
]
},
"flag_level": {
"type": "integer"
},
"title": {
"type": [
"string",
@ -109,7 +106,6 @@
"created_at_age",
"trust_level",
"manual_locked_trust_level",
"flag_level",
"title",
"time_read",
"staged",

View File

@ -46,9 +46,6 @@
"manual_locked_trust_level": {
"type": ["string", "null"]
},
"flag_level": {
"type": "integer"
},
"title": {
"type": ["string", "null"]
},
@ -509,7 +506,6 @@
"created_at_age",
"trust_level",
"manual_locked_trust_level",
"flag_level",
"title",
"time_read",
"staged",