mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-19 20:14:59 +02:00
remove IF NOT EXISTS in CREATE VIEW
This commit is contained in:
@@ -64,7 +64,7 @@ async def m001_initial(db):
|
|||||||
|
|
||||||
await db.execute(
|
await db.execute(
|
||||||
"""
|
"""
|
||||||
CREATE VIEW IF NOT EXISTS balances AS
|
CREATE VIEW balances AS
|
||||||
SELECT wallet, COALESCE(SUM(s), 0) AS balance FROM (
|
SELECT wallet, COALESCE(SUM(s), 0) AS balance FROM (
|
||||||
SELECT wallet, SUM(amount) AS s -- incoming
|
SELECT wallet, SUM(amount) AS s -- incoming
|
||||||
FROM apipayments
|
FROM apipayments
|
||||||
@@ -144,7 +144,7 @@ async def m004_ensure_fees_are_always_negative(db):
|
|||||||
await db.execute("DROP VIEW balances")
|
await db.execute("DROP VIEW balances")
|
||||||
await db.execute(
|
await db.execute(
|
||||||
"""
|
"""
|
||||||
CREATE VIEW IF NOT EXISTS balances AS
|
CREATE VIEW balances AS
|
||||||
SELECT wallet, COALESCE(SUM(s), 0) AS balance FROM (
|
SELECT wallet, COALESCE(SUM(s), 0) AS balance FROM (
|
||||||
SELECT wallet, SUM(amount) AS s -- incoming
|
SELECT wallet, SUM(amount) AS s -- incoming
|
||||||
FROM apipayments
|
FROM apipayments
|
||||||
|
Reference in New Issue
Block a user