Skip to content

Commit

Permalink
Try Mike's Magic Migration Method (pypi#16722)
Browse files Browse the repository at this point in the history
  • Loading branch information
di committed Sep 16, 2024
1 parent 6eb044f commit ffebdad
Showing 1 changed file with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,35 @@ def upgrade():
"author_email_verified",
sa.Boolean(),
server_default=sa.text("false"),
nullable=False,
nullable=True,
),
)
op.execute(
"""
UPDATE releases
SET author_email_verified = false
WHERE author_email_verified IS NULL
"""
)
op.alter_column("releases", "author_email_verified", nullable=False)

op.add_column(
"releases",
sa.Column(
"maintainer_email_verified",
sa.Boolean(),
server_default=sa.text("false"),
nullable=False,
nullable=True,
),
)
op.execute(
"""
UPDATE releases
SET maintainer_email_verified = false
WHERE maintainer_email_verified IS NULL
"""
)
op.alter_column("releases", "maintainer_email_verified", nullable=False)


def downgrade():
Expand Down

0 comments on commit ffebdad

Please sign in to comment.