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
ae1372d9
Commit
ae1372d9
authored
Apr 11, 2017
by
Yorick Peterse
Committed by
Felipe Artur
Apr 11, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch 'zj-fk-ci-triggers' into 'master'
Add foreign key on trigger requests See merge request !10537
parent
219ac0b5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
1 deletion
+22
-1
app/models/ci/trigger.rb
app/models/ci/trigger.rb
+1
-1
changelogs/unreleased/zj-fk-ci-triggers.yml
changelogs/unreleased/zj-fk-ci-triggers.yml
+4
-0
db/migrate/20170407135259_add_foreigh_key_trigger_requests_trigger.rb
...0170407135259_add_foreigh_key_trigger_requests_trigger.rb
+15
-0
db/schema.rb
db/schema.rb
+2
-0
No files found.
app/models/ci/trigger.rb
View file @
ae1372d9
...
...
@@ -7,7 +7,7 @@ module Ci
belongs_to
:project
belongs_to
:owner
,
class_name:
"User"
has_many
:trigger_requests
,
dependent: :destroy
has_many
:trigger_requests
has_one
:trigger_schedule
,
dependent: :destroy
validates
:token
,
presence:
true
,
uniqueness:
true
...
...
changelogs/unreleased/zj-fk-ci-triggers.yml
0 → 100644
View file @
ae1372d9
---
title
:
Add foreign key for ci_trigger_requests on ci_triggers
merge_request
:
10537
author
:
db/migrate/20170407135259_add_foreigh_key_trigger_requests_trigger.rb
0 → 100644
View file @
ae1372d9
class
AddForeighKeyTriggerRequestsTrigger
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
add_concurrent_foreign_key
(
:ci_trigger_requests
,
:ci_triggers
,
column: :trigger_id
)
end
def
down
remove_foreign_key
(
:ci_trigger_requests
,
column: :trigger_id
)
end
end
db/schema.rb
View file @
ae1372d9
...
...
@@ -12,6 +12,7 @@
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
20170408033905
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
enable_extension
"pg_trgm"
...
...
@@ -1356,6 +1357,7 @@ ActiveRecord::Schema.define(version: 20170408033905) do
add_foreign_key
"chat_teams"
,
"namespaces"
,
on_delete: :cascade
add_foreign_key
"ci_builds"
,
"ci_pipelines"
,
column:
"auto_canceled_by_id"
,
name:
"fk_a2141b1522"
,
on_delete: :nullify
add_foreign_key
"ci_pipelines"
,
"ci_pipelines"
,
column:
"auto_canceled_by_id"
,
name:
"fk_262d4c2d19"
,
on_delete: :nullify
add_foreign_key
"ci_trigger_requests"
,
"ci_triggers"
,
column:
"trigger_id"
,
name:
"fk_b8ec8b7245"
,
on_delete: :cascade
add_foreign_key
"ci_trigger_schedules"
,
"ci_triggers"
,
column:
"trigger_id"
,
name:
"fk_90a406cc94"
,
on_delete: :cascade
add_foreign_key
"ci_triggers"
,
"users"
,
column:
"owner_id"
,
name:
"fk_e8e10d1964"
,
on_delete: :cascade
add_foreign_key
"container_repositories"
,
"projects"
...
...
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