From e954d86d77fe7f1e2cfc52012266d618bd30a96c Mon Sep 17 00:00:00 2001 From: Giovanni M Guidini <99758426+giovanni-guidini@users.noreply.github.com> Date: Wed, 5 Jun 2024 12:15:28 +0200 Subject: [PATCH] add field to GithubAppInstallation for suspended apps (#237) --- ...0056_githubappinstallation_is_suspended.py | 25 +++++++++++++++++++ shared/django_apps/codecov_auth/models.py | 2 ++ 2 files changed, 27 insertions(+) create mode 100644 shared/django_apps/codecov_auth/migrations/0056_githubappinstallation_is_suspended.py diff --git a/shared/django_apps/codecov_auth/migrations/0056_githubappinstallation_is_suspended.py b/shared/django_apps/codecov_auth/migrations/0056_githubappinstallation_is_suspended.py new file mode 100644 index 00000000..dd210631 --- /dev/null +++ b/shared/django_apps/codecov_auth/migrations/0056_githubappinstallation_is_suspended.py @@ -0,0 +1,25 @@ +# Generated by Django 4.2.13 on 2024-06-03 13:42 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("codecov_auth", "0055_session_login_session"), + ] + + # BEGIN; + # -- + # -- Add field is_suspended to githubappinstallation + # -- + # ALTER TABLE "codecov_auth_githubappinstallation" ADD COLUMN "is_suspended" boolean DEFAULT false NOT NULL; + # ALTER TABLE "codecov_auth_githubappinstallation" ALTER COLUMN "is_suspended" DROP DEFAULT; + # COMMIT; + + operations = [ + migrations.AddField( + model_name="githubappinstallation", + name="is_suspended", + field=models.BooleanField(default=False), + ), + ] diff --git a/shared/django_apps/codecov_auth/models.py b/shared/django_apps/codecov_auth/models.py index 66d31826..e03ff606 100644 --- a/shared/django_apps/codecov_auth/models.py +++ b/shared/django_apps/codecov_auth/models.py @@ -502,6 +502,8 @@ class GithubAppInstallation( # Same comments for app_id apply pem_path = models.TextField(null=True, blank=False) + is_suspended = models.BooleanField(null=False, default=False) + owner = models.ForeignKey( Owner, null=False,