fix migration for postgres

This commit is contained in:
callebtc 2023-01-06 11:13:25 +01:00
parent 6cd5e44ad6
commit 407128fd61

View file

@ -72,8 +72,13 @@ async def m005_webhook_headers_and_body(db):
async def m006_redux(db):
"""
Add UUID ID's to links and migrates existing data
Migrate ID column type to string for UUIDs and migrate existing data
"""
# we can simply change the column type for postgres
if db.type != "SQLITE":
await db.execute("ALTER TABLE lnurlp.pay_links ALTER COLUMN id TYPE TEXT;")
else:
# but we have to do this for sqlite
await db.execute("ALTER TABLE lnurlp.pay_links RENAME TO pay_links_old")
await db.execute(
f"""