Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit 1f0a5e6

Browse files
add flags_id nullable field to new Flake model (#484)
1 parent f7dae7d commit 1f0a5e6

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

shared/django_apps/test_analytics/migrations/0001_initial.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33
from django.db import migrations, models
44

5+
"""
6+
BEGIN;
7+
--
8+
-- Create model Flake
9+
--
10+
CREATE TABLE "test_analytics_flake" ("id" bigint NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, "repoid" integer NOT NULL, "test_id" bytea NOT NULL, "recent_passes_count" integer NOT NULL, "count" integer NOT NULL, "fail_count" integer NOT NULL, "start_date" timestamp with time zone NOT NULL, "end_date" timestamp with time zone NULL);
11+
CREATE INDEX "test_analyt_repoid_fcd881_idx" ON "test_analytics_flake" ("repoid");
12+
CREATE INDEX "test_analyt_test_id_f504a1_idx" ON "test_analytics_flake" ("test_id");
13+
CREATE INDEX "test_analyt_repoid_0690c3_idx" ON "test_analytics_flake" ("repoid", "test_id");
14+
CREATE INDEX "test_analyt_repoid_9e2402_idx" ON "test_analytics_flake" ("repoid", "end_date");
15+
COMMIT;
16+
"""
17+
518

619
class Migration(migrations.Migration):
720
initial = True
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Generated by Django 4.2.16 on 2025-01-20 17:38
2+
3+
from django.db import migrations, models
4+
5+
"""
6+
BEGIN;
7+
--
8+
-- Add field flags_id to flake
9+
--
10+
ALTER TABLE "test_analytics_flake" ADD COLUMN "flags_id" bytea NULL;
11+
COMMIT;
12+
"""
13+
14+
15+
class Migration(migrations.Migration):
16+
dependencies = [
17+
("test_analytics", "0001_initial"),
18+
]
19+
20+
operations = [
21+
migrations.AddField(
22+
model_name="flake",
23+
name="flags_id",
24+
field=models.BinaryField(null=True),
25+
),
26+
]

shared/django_apps/test_analytics/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class Flake(models.Model):
1010

1111
repoid = models.IntegerField()
1212
test_id = models.BinaryField()
13+
flags_id = models.BinaryField(null=True)
1314

1415
recent_passes_count = models.IntegerField()
1516
count = models.IntegerField()

0 commit comments

Comments
 (0)