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
fcb6dd68
Commit
fcb6dd68
authored
May 08, 2018
by
Tiago Botelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds unique constraint to ProjectMirrorData project_id index
parent
4caf58a1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
2 deletions
+33
-2
db/migrate/20180508102840_add_unique_constraint_to_project_mirror_data_project_id_index.rb
...que_constraint_to_project_mirror_data_project_id_index.rb
+31
-0
db/schema.rb
db/schema.rb
+2
-2
No files found.
db/migrate/20180508102840_add_unique_constraint_to_project_mirror_data_project_id_index.rb
0 → 100644
View file @
fcb6dd68
class
AddUniqueConstraintToProjectMirrorDataProjectIdIndex
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
add_concurrent_index
(
:project_mirror_data
,
:project_id
,
unique:
true
,
name:
'index_project_mirror_data_on_project_id_unique'
)
remove_concurrent_index_by_name
(
:project_mirror_data
,
'index_project_mirror_data_on_project_id'
)
rename_index
(
:project_mirror_data
,
'index_project_mirror_data_on_project_id_unique'
,
'index_project_mirror_data_on_project_id'
)
end
def
down
rename_index
(
:project_mirror_data
,
'index_project_mirror_data_on_project_id'
,
'index_project_mirror_data_on_project_id_old'
)
add_concurrent_index
(
:project_mirror_data
,
:project_id
)
remove_concurrent_index_by_name
(
:project_mirror_data
,
'index_project_mirror_data_on_project_id_old'
)
end
end
db/schema.rb
View file @
fcb6dd68
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
#
#
# It's strongly recommended that you check this file into your version control system.
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2018050810
0222
)
do
ActiveRecord
::
Schema
.
define
(
version:
2018050810
2840
)
do
# These are extensions that must be enabled in order to support this database
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
enable_extension
"plpgsql"
...
@@ -1536,7 +1536,7 @@ ActiveRecord::Schema.define(version: 20180508100222) do
...
@@ -1536,7 +1536,7 @@ ActiveRecord::Schema.define(version: 20180508100222) do
end
end
add_index
"project_mirror_data"
,
[
"jid"
],
name:
"index_project_mirror_data_on_jid"
,
using: :btree
add_index
"project_mirror_data"
,
[
"jid"
],
name:
"index_project_mirror_data_on_jid"
,
using: :btree
add_index
"project_mirror_data"
,
[
"project_id"
],
name:
"index_project_mirror_data_on_project_id"
,
using: :btree
add_index
"project_mirror_data"
,
[
"project_id"
],
name:
"index_project_mirror_data_on_project_id"
,
u
nique:
true
,
u
sing: :btree
add_index
"project_mirror_data"
,
[
"status"
],
name:
"index_project_mirror_data_on_status"
,
using: :btree
add_index
"project_mirror_data"
,
[
"status"
],
name:
"index_project_mirror_data_on_status"
,
using: :btree
create_table
"project_statistics"
,
force: :cascade
do
|
t
|
create_table
"project_statistics"
,
force: :cascade
do
|
t
|
...
...
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