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
1e541815
Commit
1e541815
authored
Apr 05, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve migration for container repositories table
parent
6b565f53
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
db/migrate/20170322013926_create_container_repository.rb
db/migrate/20170322013926_create_container_repository.rb
+7
-2
db/schema.rb
db/schema.rb
+8
-2
No files found.
db/migrate/20170322013926_create_container_repository.rb
View file @
1e541815
...
@@ -5,8 +5,13 @@ class CreateContainerRepository < ActiveRecord::Migration
...
@@ -5,8 +5,13 @@ class CreateContainerRepository < ActiveRecord::Migration
def
change
def
change
create_table
:container_repositories
do
|
t
|
create_table
:container_repositories
do
|
t
|
t
.
integer
:project_id
t
.
references
:project
,
foreign_key:
true
,
null:
false
t
.
string
:name
t
.
string
:name
,
null:
false
t
.
timestamps
null:
false
end
end
add_index
:container_repositories
,
:project_id
add_index
:container_repositories
,
[
:project_id
,
:name
],
unique:
true
end
end
end
end
db/schema.rb
View file @
1e541815
...
@@ -324,10 +324,15 @@ ActiveRecord::Schema.define(version: 20170329124448) do
...
@@ -324,10 +324,15 @@ ActiveRecord::Schema.define(version: 20170329124448) do
add_index
"ci_variables"
,
[
"project_id"
],
name:
"index_ci_variables_on_project_id"
,
using: :btree
add_index
"ci_variables"
,
[
"project_id"
],
name:
"index_ci_variables_on_project_id"
,
using: :btree
create_table
"container_repositories"
,
force: :cascade
do
|
t
|
create_table
"container_repositories"
,
force: :cascade
do
|
t
|
t
.
integer
"project_id"
t
.
integer
"project_id"
,
null:
false
t
.
string
"name"
t
.
string
"name"
,
null:
false
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
end
end
add_index
"container_repositories"
,
[
"project_id"
,
"name"
],
name:
"index_container_repositories_on_project_id_and_name"
,
unique:
true
,
using: :btree
add_index
"container_repositories"
,
[
"project_id"
],
name:
"index_container_repositories_on_project_id"
,
using: :btree
create_table
"deploy_keys_projects"
,
force: :cascade
do
|
t
|
create_table
"deploy_keys_projects"
,
force: :cascade
do
|
t
|
t
.
integer
"deploy_key_id"
,
null:
false
t
.
integer
"deploy_key_id"
,
null:
false
t
.
integer
"project_id"
,
null:
false
t
.
integer
"project_id"
,
null:
false
...
@@ -1304,6 +1309,7 @@ ActiveRecord::Schema.define(version: 20170329124448) do
...
@@ -1304,6 +1309,7 @@ ActiveRecord::Schema.define(version: 20170329124448) do
add_foreign_key
"boards"
,
"projects"
add_foreign_key
"boards"
,
"projects"
add_foreign_key
"chat_teams"
,
"namespaces"
,
on_delete: :cascade
add_foreign_key
"chat_teams"
,
"namespaces"
,
on_delete: :cascade
add_foreign_key
"ci_triggers"
,
"users"
,
column:
"owner_id"
,
name:
"fk_e8e10d1964"
,
on_delete: :cascade
add_foreign_key
"ci_triggers"
,
"users"
,
column:
"owner_id"
,
name:
"fk_e8e10d1964"
,
on_delete: :cascade
add_foreign_key
"container_repositories"
,
"projects"
add_foreign_key
"issue_metrics"
,
"issues"
,
on_delete: :cascade
add_foreign_key
"issue_metrics"
,
"issues"
,
on_delete: :cascade
add_foreign_key
"label_priorities"
,
"labels"
,
on_delete: :cascade
add_foreign_key
"label_priorities"
,
"labels"
,
on_delete: :cascade
add_foreign_key
"label_priorities"
,
"projects"
,
on_delete: :cascade
add_foreign_key
"label_priorities"
,
"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