Skip to content

Commit a6c8d8f

Browse files
authored
Migrations fix (#15)
1 parent 3f232ba commit a6c8d8f

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

migrations/versions/6a486347af93_order.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +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"
27-
SET "button".order={i+1},
28-
"button".link='a',
29-
"button".type='b'
30-
WHERE "button".id={res[i]}"""))
26+
conn.execute(sa.text(f"""UPDATE "button"
27+
SET "order"={i + 1},
28+
"link"='#',
29+
"type"='external'
30+
WHERE id={res[i][0]}"""))
3131
op.alter_column('button', 'order', nullable=False)
3232
op.alter_column('button', 'link', nullable=False)
3333
op.alter_column('button', 'type', nullable=False)

0 commit comments

Comments
 (0)