Skip to content

Commit 7f03880

Browse files
committed
reverts defaults
1 parent c7e1a82 commit 7f03880

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
"""set privacy_hide_email to true. Reverts "set privacy_hide_email to false temporarily" (5e27063c3ac9)
2+
3+
Revision ID: 58012c1e1b1b
4+
Revises: 77ac824a77ff
5+
Create Date: 2024-12-17 10:13:24.800681+00:00
6+
7+
"""
8+
from alembic import op
9+
from sqlalchemy.sql import expression
10+
11+
# revision identifiers, used by Alembic.
12+
revision = "58012c1e1b1b"
13+
down_revision = "77ac824a77ff"
14+
branch_labels = None
15+
depends_on = None
16+
17+
18+
def upgrade():
19+
# server_default of privacy_hide_email to true
20+
with op.batch_alter_table("users") as batch_op:
21+
batch_op.alter_column("privacy_hide_email", server_default=expression.true())
22+
23+
# Reset all to default: Revert existing values in the database to true
24+
op.execute("UPDATE users SET privacy_hide_email = true")
25+
26+
27+
def downgrade():
28+
# Change the server_default of privacy_hide_email to false
29+
with op.batch_alter_table("users") as batch_op:
30+
batch_op.alter_column("privacy_hide_email", server_default=expression.false())
31+
32+
# Reset all to default: Update existing values in the database
33+
op.execute("UPDATE users SET privacy_hide_email = false")

0 commit comments

Comments
 (0)