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
4ccca52f
Commit
4ccca52f
authored
Jun 03, 2020
by
Patrick Derichs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename CONSTRAINT on resource_state_events
parent
509df13f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
db/migrate/20200603073101_change_constraint_name_on_resource_state_events.rb
...073101_change_constraint_name_on_resource_state_events.rb
+16
-0
db/structure.sql
db/structure.sql
+2
-1
No files found.
db/migrate/20200603073101_change_constraint_name_on_resource_state_events.rb
0 → 100644
View file @
4ccca52f
# frozen_string_literal: true
class
ChangeConstraintNameOnResourceStateEvents
<
ActiveRecord
::
Migration
[
6.0
]
DOWNTIME
=
false
NEW_CONSTRAINT_NAME
=
'state_events_must_belong_to_issue_or_merge_request_or_epic'
OLD_CONSTRAINT_NAME
=
'resource_state_events_must_belong_to_issue_or_merge_request_or_epic'
def
up
execute
"ALTER TABLE resource_state_events RENAME CONSTRAINT
#{
OLD_CONSTRAINT_NAME
}
TO
#{
NEW_CONSTRAINT_NAME
}
;"
end
def
down
execute
"ALTER TABLE resource_state_events RENAME CONSTRAINT
#{
NEW_CONSTRAINT_NAME
}
TO
#{
OLD_CONSTRAINT_NAME
}
;"
end
end
db/structure.sql
View file @
4ccca52f
...
@@ -5895,7 +5895,7 @@ CREATE TABLE public.resource_state_events (
...
@@ -5895,7 +5895,7 @@ CREATE TABLE public.resource_state_events (
created_at
timestamp
with
time
zone
NOT
NULL
,
created_at
timestamp
with
time
zone
NOT
NULL
,
state
smallint
NOT
NULL
,
state
smallint
NOT
NULL
,
epic_id
integer
,
epic_id
integer
,
CONSTRAINT
resource_state_events_must_belong_to_issue_or_merge_request_or_
CHECK
((((
issue_id
<>
NULL
::
bigint
)
AND
(
merge_request_id
IS
NULL
)
AND
(
epic_id
IS
NULL
))
OR
((
issue_id
IS
NULL
)
AND
(
merge_request_id
<>
NULL
::
bigint
)
AND
(
epic_id
IS
NULL
))
OR
((
issue_id
IS
NULL
)
AND
(
merge_request_id
IS
NULL
)
AND
(
epic_id
<>
NULL
::
integer
))))
CONSTRAINT
state_events_must_belong_to_issue_or_merge_request_or_epic
CHECK
((((
issue_id
<>
NULL
::
bigint
)
AND
(
merge_request_id
IS
NULL
)
AND
(
epic_id
IS
NULL
))
OR
((
issue_id
IS
NULL
)
AND
(
merge_request_id
<>
NULL
::
bigint
)
AND
(
epic_id
IS
NULL
))
OR
((
issue_id
IS
NULL
)
AND
(
merge_request_id
IS
NULL
)
AND
(
epic_id
<>
NULL
::
integer
))))
);
);
CREATE
SEQUENCE
public
.
resource_state_events_id_seq
CREATE
SEQUENCE
public
.
resource_state_events_id_seq
...
@@ -13776,5 +13776,6 @@ COPY "schema_migrations" (version) FROM STDIN;
...
@@ -13776,5 +13776,6 @@ COPY "schema_migrations" (version) FROM STDIN;
20200527152116
20200527152116
20200527152657
20200527152657
20200528123703
20200528123703
20200603073101
\
.
\
.
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