fix migration for postgres
This commit is contained in:
parent
6cd5e44ad6
commit
407128fd61
1 changed files with 69 additions and 64 deletions
|
|
@ -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"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue