Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arkindex
Backend
Commits
3dbcf469
Commit
3dbcf469
authored
1 year ago
by
Bastien Abadie
Browse files
Options
Downloads
Patches
Plain Diff
Update workflow creation date to respect process_started_after_created constraint
parent
bb399842
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2030
Update workflow creation date to respect process_started_after_created constraint
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
arkindex/process/migrations/0005_migrate_workflows.py
+13
-0
13 additions, 0 deletions
arkindex/process/migrations/0005_migrate_workflows.py
with
13 additions
and
0 deletions
arkindex/process/migrations/0005_migrate_workflows.py
+
13
−
0
View file @
3dbcf469
...
...
@@ -14,6 +14,19 @@ class Migration(migrations.Migration):
operations
=
[
migrations
.
RunSQL
(
[
# In some rare cases, the workflow creation date is set a few milliseconds
# before the process creation date, breaking the process_started_after_created constraint
"""
update ponos_workflow w
set created = data.created
from (
select w.id, p.created
from process_process p
inner join ponos_workflow w on (w.id=p.workflow_id)
where w.created < p.created
) data
where data.id=w.id;
"""
,
# This query cannot be done with QuerySet.update, because Django does not allow joining during an update.
# This is why we use RunSQL here and not RunPython.
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment