From 55eacd1009a9ce69ddc94e9209db2441f38c4399 Mon Sep 17 00:00:00 2001 From: Arc Date: Tue, 19 Nov 2024 23:00:15 +0000 Subject: [PATCH] migration fix attempt --- migrations.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/migrations.py b/migrations.py index 91d5819..94aa7db 100644 --- a/migrations.py +++ b/migrations.py @@ -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":""}, )