postgres fix
This commit is contained in:
parent
9dcaf125b0
commit
7f42c60d5a
2 changed files with 13 additions and 15 deletions
3
crud.py
3
crud.py
|
|
@ -280,8 +280,9 @@ async def set_config_nwc(key: str, value: str):
|
||||||
|
|
||||||
await db.execute(
|
await db.execute(
|
||||||
"""
|
"""
|
||||||
INSERT OR REPLACE INTO nwcprovider.config (key, value)
|
INSERT INTO nwcprovider.config (key, value)
|
||||||
VALUES (:key, :value)
|
VALUES (:key, :value)
|
||||||
|
ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value;
|
||||||
""",
|
""",
|
||||||
{"key": key, "value": value},
|
{"key": key, "value": value},
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -68,15 +68,15 @@ async def m003_default_config(db):
|
||||||
"""
|
"""
|
||||||
await db.execute(
|
await db.execute(
|
||||||
"""
|
"""
|
||||||
INSERT OR REPLACE INTO nwcprovider.config
|
INSERT INTO nwcprovider.config (key, value) VALUES ('relay', 'nostrclient')
|
||||||
(key, value) VALUES ('relay', 'nostrclient');
|
ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value;
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
new_private_key = bytes.hex(secp256k1._gen_private_key())
|
new_private_key = bytes.hex(secp256k1._gen_private_key())
|
||||||
await db.execute(
|
await db.execute(
|
||||||
"""
|
"""
|
||||||
INSERT OR REPLACE INTO nwcprovider.config
|
INSERT INTO nwcprovider.config (key, value) VALUES ('provider_key', :provider_key)
|
||||||
(key, value) VALUES ('provider_key', :provider_key);
|
ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value;
|
||||||
""",
|
""",
|
||||||
{"provider_key": new_private_key},
|
{"provider_key": new_private_key},
|
||||||
)
|
)
|
||||||
|
|
@ -86,16 +86,14 @@ async def m004_default_config2(db):
|
||||||
"""
|
"""
|
||||||
Default config
|
Default config
|
||||||
"""
|
"""
|
||||||
|
|
||||||
await db.execute(
|
await db.execute(
|
||||||
"""
|
"""
|
||||||
INSERT OR REPLACE INTO nwcprovider.config
|
INSERT INTO nwcprovider.config (key, value) VALUES ('relay_alias', :value)
|
||||||
(key, value) VALUES ('relay_alias', :value);
|
ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value;
|
||||||
""",
|
""",
|
||||||
{"value": ""},
|
{"value": ""},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
async def m005_key_last_used(db):
|
async def m005_key_last_used(db):
|
||||||
"""
|
"""
|
||||||
Add last_used to keys
|
Add last_used to keys
|
||||||
|
|
@ -111,11 +109,10 @@ async def m006_default_config3(db):
|
||||||
"""
|
"""
|
||||||
Default config
|
Default config
|
||||||
"""
|
"""
|
||||||
|
|
||||||
await db.execute(
|
await db.execute(
|
||||||
"""
|
"""
|
||||||
INSERT OR REPLACE INTO nwcprovider.config
|
INSERT INTO nwcprovider.config (key, value) VALUES ('handle_missed_events', :value)
|
||||||
(key, value) VALUES ('handle_missed_events', :value);
|
ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value;
|
||||||
""",
|
""",
|
||||||
{"value": "0"},
|
{"value": "0"},
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue