Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
05c4cfe1
Commit
05c4cfe1
authored
Jun 03, 2019
by
Peter Leitzen
Committed by
Rémy Coutable
Jun 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "Remove unused `users.support_bot`"
parent
9bd2f7c6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
13 deletions
+32
-13
config/pseudonymizer.yml
config/pseudonymizer.yml
+1
-1
db/schema.rb
db/schema.rb
+0
-3
ee/app/models/ee/user.rb
ee/app/models/ee/user.rb
+4
-9
ee/db/post_migrate/20190511144331_remove_users_support_type.rb
.../post_migrate/20190511144331_remove_users_support_type.rb
+27
-0
No files found.
config/pseudonymizer.yml
View file @
05c4cfe1
...
...
@@ -470,7 +470,7 @@ tables:
-
ghost
-
last_activity_on
-
notified_of_own_activity
-
support_bot
-
bot_type
-
preferred_language
-
theme_id
db/schema.rb
View file @
05c4cfe1
...
...
@@ -3289,7 +3289,6 @@ ActiveRecord::Schema.define(version: 20190530154715) do
t
.
boolean
"ghost"
t
.
date
"last_activity_on"
t
.
boolean
"notified_of_own_activity"
t
.
boolean
"support_bot"
t
.
string
"preferred_language"
t
.
boolean
"email_opted_in"
t
.
string
"email_opted_in_ip"
...
...
@@ -3322,8 +3321,6 @@ ActiveRecord::Schema.define(version: 20190530154715) do
t
.
index
[
"reset_password_token"
],
name:
"index_users_on_reset_password_token"
,
unique:
true
,
using: :btree
t
.
index
[
"state"
],
name:
"index_users_on_state"
,
using: :btree
t
.
index
[
"state"
],
name:
"index_users_on_state_and_internal"
,
where:
"((ghost <> true) AND (bot_type IS NULL))"
,
using: :btree
t
.
index
[
"state"
],
name:
"index_users_on_state_and_internal_attrs"
,
where:
"((ghost <> true) AND (support_bot <> true))"
,
using: :btree
t
.
index
[
"support_bot"
],
name:
"index_users_on_support_bot"
,
using: :btree
t
.
index
[
"username"
],
name:
"index_users_on_username"
,
using: :btree
t
.
index
[
"username"
],
name:
"index_users_on_username_trigram"
,
using: :gin
,
opclasses:
{
"username"
=>
"gin_trgm_ops"
}
end
...
...
ee/app/models/ee/user.rb
View file @
05c4cfe1
...
...
@@ -269,7 +269,10 @@ module EE
end
def
bot?
has_bot_type?
?
bot_type
.
present?
:
old_support_bot
return
bot_type
.
present?
if
has_attribute?
(
:bot_type
)
# Some older *migration* specs utilize this removed column
read_attribute
(
:support_bot
)
end
protected
...
...
@@ -283,14 +286,6 @@ module EE
private
def
has_bot_type?
has_attribute?
(
:bot_type
)
end
def
old_support_bot
read_attribute
(
:support_bot
)
end
def
namespace_union
(
select
=
:id
)
::
Gitlab
::
SQL
::
Union
.
new
([
::
Namespace
.
select
(
select
).
where
(
type:
nil
,
owner:
self
),
...
...
ee/db/post_migrate/20190511144331_remove_users_support_type.rb
0 → 100644
View file @
05c4cfe1
# frozen_string_literal: true
class
RemoveUsersSupportType
<
ActiveRecord
::
Migration
[
5.1
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
INDEX_STATE_INTERNAL_ATTRS
=
'index_users_on_state_and_internal_attrs'
disable_ddl_transaction!
def
up
remove_concurrent_index
:users
,
:state
,
name:
INDEX_STATE_INTERNAL_ATTRS
remove_concurrent_index
:users
,
:support_bot
remove_column
:users
,
:support_bot
end
def
down
add_column
:users
,
:support_bot
,
:boolean
add_concurrent_index
:users
,
:support_bot
add_concurrent_index
:users
,
:state
,
name:
INDEX_STATE_INTERNAL_ATTRS
,
where:
'ghost <> true AND support_bot <> true'
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment