-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Model definitions for GithubAppInstallation. This will unlock multiple apps for an org. It also will improve how we keep track of what repos an installation can access. context: codecov/engineering-team#969
- Loading branch information
1 parent
86431d3
commit a58ea09
Showing
4 changed files
with
158 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Generated by Django 4.2.7 on 2024-01-17 13:37 | ||
|
||
import uuid | ||
|
||
import django.contrib.postgres.fields | ||
import django.db.models.deletion | ||
import django_prometheus.models | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("codecov_auth", "0047_auto_20231009_1257"), | ||
] | ||
|
||
# BEGIN; | ||
# -- | ||
# -- Create model GithubAppInstallation | ||
# -- | ||
# CREATE TABLE "codecov_auth_githubappinstallation" ("id" bigint NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, "external_id" uuid NOT NULL, "created_at" timestamp with time zone NOT NULL, "updated_at" timestamp with time zone NOT NULL, "installation_id" integer NOT NULL, "name" text NOT NULL, "repository_service_ids" text[] NULL, "owner_id" integer NOT NULL); | ||
# ALTER TABLE "codecov_auth_githubappinstallation" ADD CONSTRAINT "codecov_auth_githuba_owner_id_82ba29b1_fk_owners_ow" FOREIGN KEY ("owner_id") REFERENCES "owners" ("ownerid") DEFERRABLE INITIALLY DEFERRED; | ||
# CREATE INDEX "codecov_auth_githubappinstallation_owner_id_82ba29b1" ON "codecov_auth_githubappinstallation" ("owner_id"); | ||
# COMMIT; | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="GithubAppInstallation", | ||
fields=[ | ||
("id", models.BigAutoField(primary_key=True, serialize=False)), | ||
("external_id", models.UUIDField(default=uuid.uuid4, editable=False)), | ||
("created_at", models.DateTimeField(auto_now_add=True)), | ||
("updated_at", models.DateTimeField(auto_now=True)), | ||
("installation_id", models.IntegerField()), | ||
("name", models.TextField(default="codecov_app_installation")), | ||
( | ||
"repository_service_ids", | ||
django.contrib.postgres.fields.ArrayField( | ||
base_field=models.TextField(), null=True, size=None | ||
), | ||
), | ||
( | ||
"owner", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="github_app_installations", | ||
to="codecov_auth.owner", | ||
), | ||
), | ||
], | ||
options={ | ||
"abstract": False, | ||
}, | ||
bases=( | ||
django_prometheus.models.ExportModelOperationsMixin( | ||
"codecov_auth.github_app_installation" | ||
), | ||
models.Model, | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters