File tree 2 files changed +54
-0
lines changed
2 files changed +54
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Generated by Django 3.2.25 on 2024-12-19 19:58
2
+
3
+ from django .db import migrations
4
+
5
+
6
+ class Migration (migrations .Migration ):
7
+
8
+ dependencies = [
9
+ ('commitfest' , '0007_cfbot_add_scheduled' ),
10
+ ]
11
+
12
+ operations = [
13
+ migrations .RunSQL (
14
+ """
15
+ CREATE TYPE cfbotbranch_status AS ENUM (
16
+ 'testing',
17
+ 'finished',
18
+ 'failed',
19
+ 'timeout'
20
+ );
21
+ """
22
+ ),
23
+ migrations .RunSQL (
24
+ """
25
+ CREATE TYPE cfbottask_status AS ENUM (
26
+ 'CREATED',
27
+ 'NEEDS_APPROVAL',
28
+ 'TRIGGERED',
29
+ 'EXECUTING',
30
+ 'FAILED',
31
+ 'COMPLETED',
32
+ 'SCHEDULED',
33
+ 'ABORTED',
34
+ 'ERRORED'
35
+ );
36
+ """
37
+ ),
38
+ migrations .RunSQL (
39
+ """
40
+ ALTER TABLE commitfest_cfbotbranch
41
+ ALTER COLUMN status TYPE cfbotbranch_status
42
+ USING status::cfbotbranch_status;
43
+ """
44
+ ),
45
+ migrations .RunSQL (
46
+ """
47
+ ALTER TABLE commitfest_cfbottask
48
+ ALTER COLUMN status TYPE cfbottask_status
49
+ USING status::cfbottask_status;
50
+ """
51
+ ),
52
+ ]
Original file line number Diff line number Diff line change @@ -356,6 +356,7 @@ class CfbotBranch(models.Model):
356
356
branch_name = models .TextField (null = False )
357
357
commit_id = models .TextField (null = True , blank = True )
358
358
apply_url = models .TextField (null = False )
359
+ # Actually a postgres enum column
359
360
status = models .TextField (choices = STATUS_CHOICES , null = False )
360
361
created = models .DateTimeField (auto_now_add = True )
361
362
modified = models .DateTimeField (auto_now = True )
@@ -379,6 +380,7 @@ class CfbotTask(models.Model):
379
380
patch = models .ForeignKey (Patch , on_delete = models .CASCADE , related_name = "cfbot_tasks" )
380
381
branch_id = models .IntegerField (null = False )
381
382
position = models .IntegerField (null = False )
383
+ # Actually a postgres enum column
382
384
status = models .TextField (choices = STATUS_CHOICES , null = False )
383
385
created = models .DateTimeField (auto_now_add = True )
384
386
modified = models .DateTimeField (auto_now = True )
You can’t perform that action at this time.
0 commit comments