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
77f5d81a
Commit
77f5d81a
authored
Jul 26, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing unique index to geo_node_group_links table
parent
e2cc0a70
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
db/migrate/20170717213940_create_geo_node_group_links.rb
db/migrate/20170717213940_create_geo_node_group_links.rb
+7
-1
db/schema.rb
db/schema.rb
+2
-2
No files found.
db/migrate/20170717213940_create_geo_node_group_links.rb
View file @
77f5d81a
...
...
@@ -8,17 +8,23 @@ class CreateGeoNodeGroupLinks < ActiveRecord::Migration
def
up
create_table
:geo_node_group_links
do
|
t
|
t
.
references
:geo_node
,
index:
true
,
foreign_key:
{
on_delete: :cascade
},
null:
false
t
.
integer
:group_id
,
index:
true
,
null:
false
t
.
integer
:group_id
,
null:
false
end
add_timestamps_with_timezone
:geo_node_group_links
add_concurrent_foreign_key
:geo_node_group_links
,
:namespaces
,
column: :group_id
,
on_delete: :cascade
add_concurrent_index
:geo_node_group_links
,
[
:geo_node_id
,
:group_id
],
unique:
true
end
def
down
remove_foreign_key
:geo_node_group_links
,
column: :group_id
if
index_exists?
(
:geo_node_group_links
,
[
:geo_node_id
,
:group_id
])
remove_concurrent_index
:geo_node_group_links
,
[
:geo_node_id
,
:group_id
]
end
drop_table
:geo_node_group_links
end
end
db/schema.rb
View file @
77f5d81a
...
...
@@ -640,8 +640,8 @@ ActiveRecord::Schema.define(version: 20170803130232) do
t
.
datetime
"updated_at"
,
null:
false
end
add_index
"geo_node_group_links"
,
[
"geo_node_id"
,
"group_id"
],
name:
"index_geo_node_group_links_on_geo_node_id_and_group_id"
,
unique:
true
,
using: :btree
add_index
"geo_node_group_links"
,
[
"geo_node_id"
],
name:
"index_geo_node_group_links_on_geo_node_id"
,
using: :btree
add_index
"geo_node_group_links"
,
[
"group_id"
],
name:
"index_geo_node_group_links_on_group_id"
,
using: :btree
create_table
"geo_nodes"
,
force: :cascade
do
|
t
|
t
.
string
"schema"
...
...
@@ -1985,7 +1985,7 @@ ActiveRecord::Schema.define(version: 20170803130232) do
add_foreign_key
"geo_event_log"
,
"geo_repository_renamed_events"
,
column:
"repository_renamed_event_id"
,
name:
"fk_86c84214ec"
,
on_delete: :cascade
add_foreign_key
"geo_event_log"
,
"geo_repository_updated_events"
,
column:
"repository_updated_event_id"
,
on_delete: :cascade
add_foreign_key
"geo_node_group_links"
,
"geo_nodes"
,
on_delete: :cascade
add_foreign_key
"geo_node_group_links"
,
"namespaces"
,
column:
"group_id"
,
on_delete: :cascade
add_foreign_key
"geo_node_group_links"
,
"namespaces"
,
column:
"group_id"
,
name:
"fk_e684c3550a"
,
on_delete: :cascade
add_foreign_key
"geo_repository_renamed_events"
,
"projects"
,
on_delete: :cascade
add_foreign_key
"geo_repository_updated_events"
,
"projects"
,
on_delete: :cascade
add_foreign_key
"index_statuses"
,
"projects"
,
name:
"fk_74b2492545"
,
on_delete: :cascade
...
...
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