remove IF NOT EXISTS in CREATE VIEW
This commit is contained in:
parent
c34041c49c
commit
e8882645c4
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue