migration fix attempt

This commit is contained in:
Arc 2024-11-19 23:00:15 +00:00
commit 55eacd1009

View file

@ -1,6 +1,8 @@
import secp256k1
async def m001_initial(db):
"""
Initial tables
@ -68,13 +70,13 @@ async def m003_default_config(db):
"""
await db.execute(
"""
INSERT OR IGNORE INTO nwcprovider.config (key, value) VALUES ('relay', 'nostrclient');
INSERT OR REPLACE INTO nwcprovider.config (key, value) VALUES ('relay', 'nostrclient');
"""
)
new_private_key = bytes.hex(secp256k1._gen_private_key())
await db.execute(
"""
INSERT OR IGNORE INTO nwcprovider.config (key, value) VALUES ('provider_key', :provider_key);
INSERT OR REPLACE INTO nwcprovider.config (key, value) VALUES ('provider_key', :provider_key);
""",
{"provider_key": new_private_key},
)
@ -87,9 +89,9 @@ async def m004_default_config2(db):
await db.execute(
"""
INSERT OR IGNORE INTO nwcprovider.config (key, value) VALUES ('relay_alias', ?);
INSERT OR REPLACE INTO nwcprovider.config (key, value) VALUES ('relay_alias', :value);
""",
("",),
{"value":""},
)