Skip to content

Commit 3f232ba

Browse files
authored
Update 6a486347af93_order.py (#14)
1 parent aba36d1 commit 3f232ba

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

migrations/versions/6a486347af93_order.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ def upgrade():
2323
conn = op.get_bind()
2424
res = conn.execute(sa.text("select id from button")).fetchall()
2525
for i in range(0, len(res)):
26-
conn.execute(sa.text(f'UPDATE "button" SET "button".order={i+1}, "button".link="a", "button".type="b" WHERE "button".id={res[i]}'))
26+
conn.execute(sa.text(f"""UPDATE "button"
27+
SET "button".order={i+1},
28+
"button".link='a',
29+
"button".type='b'
30+
WHERE "button".id={res[i]}"""))
2731
op.alter_column('button', 'order', nullable=False)
2832
op.alter_column('button', 'link', nullable=False)
2933
op.alter_column('button', 'type', nullable=False)

0 commit comments

Comments
 (0)