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
313f4d49
Commit
313f4d49
authored
Feb 01, 2018
by
Andreas Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add unique constraint to trending_projects#project_id.
parent
54a575f1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
1 deletion
+25
-1
changelogs/unreleased/32283-trending-projects-unique-constraint2.yml
...unreleased/32283-trending-projects-unique-constraint2.yml
+5
-0
db/migrate/20180201102129_add_unique_constraint_to_trending_projects_project_id.rb
..._add_unique_constraint_to_trending_projects_project_id.rb
+19
-0
db/schema.rb
db/schema.rb
+1
-1
No files found.
changelogs/unreleased/32283-trending-projects-unique-constraint2.yml
0 → 100644
View file @
313f4d49
---
title
:
Add unique constraint to trending_projects#project_id.
merge_request
:
16846
author
:
type
:
other
db/migrate/20180201102129_add_unique_constraint_to_trending_projects_project_id.rb
0 → 100644
View file @
313f4d49
class
AddUniqueConstraintToTrendingProjectsProjectId
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
add_concurrent_index
:trending_projects
,
:project_id
,
unique:
true
,
name:
'index_trending_projects_on_project_id_unique'
remove_concurrent_index_by_name
:trending_projects
,
'index_trending_projects_on_project_id'
rename_index
:trending_projects
,
'index_trending_projects_on_project_id_unique'
,
'index_trending_projects_on_project_id'
end
def
down
rename_index
:trending_projects
,
'index_trending_projects_on_project_id'
,
'index_trending_projects_on_project_id_old'
add_concurrent_index
:trending_projects
,
:project_id
remove_concurrent_index_by_name
:trending_projects
,
'index_trending_projects_on_project_id_old'
end
end
db/schema.rb
View file @
313f4d49
...
...
@@ -1727,7 +1727,7 @@ ActiveRecord::Schema.define(version: 20180201145907) do
t
.
integer
"project_id"
,
null:
false
end
add_index
"trending_projects"
,
[
"project_id"
],
name:
"index_trending_projects_on_project_id"
,
using: :btree
add_index
"trending_projects"
,
[
"project_id"
],
name:
"index_trending_projects_on_project_id"
,
u
nique:
true
,
u
sing: :btree
create_table
"u2f_registrations"
,
force: :cascade
do
|
t
|
t
.
text
"certificate"
...
...
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