From acf2c929513702c8126e52078c821b5b15a39f3b Mon Sep 17 00:00:00 2001 From: Timur Enikeev <163281083+DaymasS@users.noreply.github.com> Date: Sat, 10 Aug 2024 09:07:26 -0400 Subject: [PATCH] Update 52230bfc3f86_56_add_is_hidden_field.py --- .../versions/52230bfc3f86_56_add_is_hidden_field.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/migrations/versions/52230bfc3f86_56_add_is_hidden_field.py b/migrations/versions/52230bfc3f86_56_add_is_hidden_field.py index 8c9f306..6d6611e 100644 --- a/migrations/versions/52230bfc3f86_56_add_is_hidden_field.py +++ b/migrations/versions/52230bfc3f86_56_add_is_hidden_field.py @@ -20,15 +20,7 @@ def upgrade(): op.add_column('button', sa.Column('is_hidden', sa.Boolean(), nullable=True)) conn = op.get_bind() - res = conn.execute(sa.text("select * from button")).fetchall() - for i in range(0, len(res)): - conn.execute( - sa.text( - f"""UPDATE "button" - SET "is_hidden"='false' - WHERE id={res[i][0]}""" - ) - ) + conn.execute(sa.text(f"""UPDATE "button" SET "is_hidden"='false'""")) op.alter_column('button', 'is_hidden', nullable=False)