Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make plan non-nullable and drop plan type #533

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add sql, convert drop to risky
  • Loading branch information
ajay-sentry committed Feb 25, 2025
commit c1712750ca899a423817aacaf6e46f8cdcff6e34
Original file line number Diff line number Diff line change
@@ -2,14 +2,30 @@

from django.db import migrations, models

from shared.django_apps.migration_utils import RiskyRunSQL


class Migration(migrations.Migration):
"""
BEGIN;
--
-- Raw SQL operation
--
ALTER TABLE owners ALTER COLUMN plan DROP DEFAULT;
--
-- Alter field plan on owner
--
UPDATE "owners" SET "plan" = 'users-developer' WHERE "plan" IS NULL; SET CONSTRAINTS ALL IMMEDIATE;
ALTER TABLE "owners" ALTER COLUMN "plan" SET NOT NULL;
COMMIT;
"""

dependencies = [
("codecov_auth", "0066_add_pro_plan"),
]

operations = [
migrations.RunSQL("ALTER TABLE owners ALTER COLUMN plan DROP DEFAULT;"),
RiskyRunSQL("ALTER TABLE owners ALTER COLUMN plan DROP DEFAULT;"),
migrations.AlterField(
model_name="owner",
name="plan",