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
5bf6b2ec
Commit
5bf6b2ec
authored
Nov 21, 2019
by
Kerri Miller
Committed by
Andreas Brandl
Nov 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop deprecated column from projects
parent
f035deba
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
88 additions
and
2 deletions
+88
-2
changelogs/unreleased/34636-drop-deprecated-column-from-projects-table.yml
...ased/34636-drop-deprecated-column-from-projects-table.yml
+5
-0
db/post_migrate/20191015154408_drop_merge_requests_require_code_owner_approval_from_projects.rb
...rge_requests_require_code_owner_approval_from_projects.rb
+27
-0
db/schema.rb
db/schema.rb
+0
-2
spec/migrations/20191015154408_drop_merge_requests_require_code_owner_approval_from_projects_spec.rb
...equests_require_code_owner_approval_from_projects_spec.rb
+56
-0
No files found.
changelogs/unreleased/34636-drop-deprecated-column-from-projects-table.yml
0 → 100644
View file @
5bf6b2ec
---
title
:
Drop deprecated column from projects table
merge_request
:
18914
author
:
type
:
deprecated
db/post_migrate/20191015154408_drop_merge_requests_require_code_owner_approval_from_projects.rb
0 → 100644
View file @
5bf6b2ec
# frozen_string_literal: true
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class
DropMergeRequestsRequireCodeOwnerApprovalFromProjects
<
ActiveRecord
::
Migration
[
5.2
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
remove_column
:projects
,
:merge_requests_require_code_owner_approval
,
:boolean
end
def
down
add_column
:projects
,
:merge_requests_require_code_owner_approval
,
:boolean
add_concurrent_index
(
:projects
,
%i[archived pending_delete merge_requests_require_code_owner_approval]
,
name:
'projects_requiring_code_owner_approval'
,
where:
'((pending_delete = false) AND (archived = false) AND (merge_requests_require_code_owner_approval = true))'
)
end
end
db/schema.rb
View file @
5bf6b2ec
...
...
@@ -3186,7 +3186,6 @@ ActiveRecord::Schema.define(version: 2019_11_18_182722) do
t
.
bigint
"pool_repository_id"
t
.
string
"runners_token_encrypted"
t
.
string
"bfg_object_map"
t
.
boolean
"merge_requests_require_code_owner_approval"
t
.
boolean
"detected_repository_languages"
t
.
boolean
"merge_requests_disable_committers_approval"
t
.
boolean
"require_password_to_approve"
...
...
@@ -3198,7 +3197,6 @@ ActiveRecord::Schema.define(version: 2019_11_18_182722) do
t
.
date
"marked_for_deletion_at"
t
.
integer
"marked_for_deletion_by_user_id"
t
.
index
"lower((name)::text)"
,
name:
"index_projects_on_lower_name"
t
.
index
[
"archived"
,
"pending_delete"
,
"merge_requests_require_code_owner_approval"
],
name:
"projects_requiring_code_owner_approval"
,
where:
"((pending_delete = false) AND (archived = false) AND (merge_requests_require_code_owner_approval = true))"
t
.
index
[
"created_at"
,
"id"
],
name:
"index_projects_on_created_at_and_id"
t
.
index
[
"creator_id"
],
name:
"index_projects_on_creator_id"
t
.
index
[
"description"
],
name:
"index_projects_on_description_trigram"
,
opclass: :gin_trgm_ops
,
using: :gin
...
...
spec/migrations/20191015154408_drop_merge_requests_require_code_owner_approval_from_projects_spec.rb
0 → 100644
View file @
5bf6b2ec
# frozen_string_literal: true
require
'spec_helper'
require
Rails
.
root
.
join
(
'db'
,
'post_migrate'
,
'20191015154408_drop_merge_requests_require_code_owner_approval_from_projects.rb'
)
describe
DropMergeRequestsRequireCodeOwnerApprovalFromProjects
,
:migration
do
let
(
:projects_table
)
{
table
(
:projects
)
}
subject
(
:migration
)
{
described_class
.
new
}
describe
"without running the migration"
do
it
"project_table has a :merge_requests_require_code_owner_approval column"
do
expect
(
projects_table
.
column_names
)
.
to
include
(
"merge_requests_require_code_owner_approval"
)
end
it
"project_table has a :projects_requiring_code_owner_approval index"
do
expect
(
ActiveRecord
::
Base
.
connection
.
indexes
(
:projects
).
collect
(
&
:name
))
.
to
include
(
"projects_requiring_code_owner_approval"
)
end
end
describe
'#up'
do
context
"without running "
before
do
migrate!
end
it
"drops the :merge_requests_require_code_owner_approval column"
do
expect
(
projects_table
.
column_names
)
.
not_to
include
(
"merge_requests_require_code_owner_approval"
)
end
it
"drops the :projects_requiring_code_owner_approval index"
do
expect
(
ActiveRecord
::
Base
.
connection
.
indexes
(
:projects
).
collect
(
&
:name
))
.
not_to
include
(
"projects_requiring_code_owner_approval"
)
end
end
describe
"#down"
do
before
do
migration
.
up
migration
.
down
end
it
"project_table has a :merge_requests_require_code_owner_approval column"
do
expect
(
projects_table
.
column_names
)
.
to
include
(
"merge_requests_require_code_owner_approval"
)
end
it
"project_table has a :projects_requiring_code_owner_approval index"
do
expect
(
ActiveRecord
::
Base
.
connection
.
indexes
(
:projects
).
collect
(
&
:name
))
.
to
include
(
"projects_requiring_code_owner_approval"
)
end
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