Skip to content

Commit

Permalink
Add migrations for PipelineLock and Pipeline modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandf committed May 13, 2024
1 parent 9523149 commit 4f24950
Showing 1 changed file with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Generated by Django 4.1.2 on 2024-05-13 16:29

import backend.views.http.requests
from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

dependencies = [
('backend', '0029_pipelinerun_description_pipelinerun_name'),
]

operations = [
migrations.AddField(
model_name='pipeline',
name='enabled',
field=models.BooleanField(default=True),
),
migrations.AddField(
model_name='pipeline',
name='lock_expiration_policy',
field=models.CharField(choices=[(backend.views.http.requests.EnumLockExpirationPolicy['NoOp'], backend.views.http.requests.EnumLockExpirationPolicy['NoOp']), (backend.views.http.requests.EnumLockExpirationPolicy['DeleteLock'], backend.views.http.requests.EnumLockExpirationPolicy['DeleteLock']), (backend.views.http.requests.EnumLockExpirationPolicy['DisablePipeline'], backend.views.http.requests.EnumLockExpirationPolicy['DisablePipeline'])], default=backend.views.http.requests.EnumLockExpirationPolicy['DisablePipeline'], max_length=16),
),
migrations.CreateModel(
name='PipelineLock',
fields=[
('created_at', models.DateTimeField(auto_now_add=True)),
('acquired_at', models.DateTimeField(default=None, null=True)),
('expires_in', models.BigIntegerField(default=0)),
('uuid', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
('pipeline', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pipelinelocks', to='backend.pipeline')),
('pipeline_run', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='pipelinelocks', to='backend.pipelinerun')),
],
),
migrations.AddConstraint(
model_name='pipelinelock',
constraint=models.UniqueConstraint(fields=('pipeline', 'pipeline_run'), name='pipelinelock_pipeline_pipeline_run'),
),
]

0 comments on commit 4f24950

Please sign in to comment.