Skip to content

Commit

Permalink
add upload_token_required_for_public_repos, backfill and make non-nul…
Browse files Browse the repository at this point in the history
…lable (#373)

* add upload_token_required_for_public_repos, backfill and make non-nullable

* risky migration part 1

* change update query around

* remove second migration

* split into 3 steps

* one step
  • Loading branch information
nora-codecov authored Oct 3, 2024
1 parent a97eb0a commit 88117b9
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Generated by Django 4.2.16 on 2024-10-02 00:21

from django.db import migrations, models

from shared.django_apps.migration_utils import RiskyAddField


class Migration(migrations.Migration):
"""
BEGIN;
--
-- Add field upload_token_required_for_public_repos to owner
--
ALTER TABLE "owners" ADD COLUMN "upload_token_required_for_public_repos" boolean DEFAULT true NOT NULL;
ALTER TABLE "owners" ALTER COLUMN "upload_token_required_for_public_repos" DROP DEFAULT;
COMMIT;
"""

dependencies = [
("codecov_auth", "0059_alter_accountsusers_options"),
]

operations = [
RiskyAddField(
model_name="owner",
name="upload_token_required_for_public_repos",
field=models.BooleanField(default=True),
),
]
1 change: 1 addition & 0 deletions shared/django_apps/codecov_auth/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ class Meta:
onboarding_completed = models.BooleanField(default=False)
is_superuser = models.BooleanField(null=True, default=False)
max_upload_limit = models.IntegerField(null=True, default=150, blank=True)
upload_token_required_for_public_repos = models.BooleanField(default=True)

sentry_user_id = models.TextField(null=True, blank=True, unique=True)
sentry_user_data = models.JSONField(null=True)
Expand Down

0 comments on commit 88117b9

Please sign in to comment.