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
5a699322
Commit
5a699322
authored
Aug 02, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make CreateGeoNodeNamespaceLinks migration simpler
parent
aba6d7d2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
17 deletions
+5
-17
db/migrate/20170717213940_create_geo_node_namespace_links.rb
db/migrate/20170717213940_create_geo_node_namespace_links.rb
+4
-16
db/schema.rb
db/schema.rb
+1
-1
No files found.
db/migrate/20170717213940_create_geo_node_namespace_links.rb
View file @
5a699322
...
...
@@ -5,26 +5,14 @@ class CreateGeoNodeNamespaceLinks < ActiveRecord::Migration
disable_ddl_transaction!
def
up
def
change
create_table
:geo_node_namespace_links
do
|
t
|
t
.
references
:geo_node
,
index:
true
,
foreign_key:
{
on_delete: :cascade
},
null:
false
t
.
integer
:namespace_id
,
null:
false
end
add_timestamps_with_timezone
:geo_node_namespace_links
add_concurrent_foreign_key
:geo_node_namespace_links
,
:namespaces
,
column: :namespace_id
,
on_delete: :cascade
t
.
references
:namespace
,
foreign_key:
{
on_delete: :cascade
},
null:
false
add_concurrent_index
:geo_node_namespace_links
,
[
:geo_node_id
,
:namespace_id
],
unique:
true
t
.
index
[
:geo_node_id
,
:namespace_id
],
unique:
true
end
def
down
remove_foreign_key
:geo_node_namespace_links
,
column: :namespace_id
if
index_exists?
(
:geo_node_namespace_links
,
[
:geo_node_id
,
:namespace_id
])
remove_concurrent_index
:geo_node_namespace_links
,
[
:geo_node_id
,
:namespace_id
]
end
drop_table
:geo_node_namespace_links
add_timestamps_with_timezone
:geo_node_namespace_links
end
end
db/schema.rb
View file @
5a699322
...
...
@@ -1993,7 +1993,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_namespace_links"
,
"geo_nodes"
,
on_delete: :cascade
add_foreign_key
"geo_node_namespace_links"
,
"namespaces"
,
name:
"fk_41ff5fb854"
,
on_delete: :cascade
add_foreign_key
"geo_node_namespace_links"
,
"namespaces"
,
on_delete: :cascade
add_foreign_key
"geo_repositories_changed_events"
,
"geo_nodes"
,
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
...
...
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