mirror of
https://github.com/lnbits/lnbits.git
synced 2025-03-26 17:51:53 +01:00
Trigger to default fiat conversion on
Like all the other wallets
This commit is contained in:
parent
d234ab12d8
commit
3dd1c6992b
@ -684,3 +684,22 @@ async def m029_create_audit_table(db: Connection):
|
||||
);
|
||||
"""
|
||||
)
|
||||
|
||||
async def m030_add_currency_to_wallet(db: Connection):
|
||||
"""
|
||||
Setting currency to default is heavy, so easier just to add a trigger.
|
||||
"""
|
||||
await db.execute(
|
||||
|
||||
"""
|
||||
CREATE TRIGGER IF NOT EXISTS set_default_currency
|
||||
AFTER INSERT ON wallets
|
||||
FOR EACH ROW
|
||||
WHEN NEW.currency IS NULL
|
||||
BEGIN
|
||||
UPDATE wallets
|
||||
SET currency = 'USD'
|
||||
WHERE id = NEW.id;
|
||||
END;
|
||||
"""
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user