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":""}, )