adjust copilot to postgres branch.

This commit is contained in:
fiatjaf
2021-07-02 17:36:26 -03:00
parent 46eab3b35e
commit 2466cd59db
2 changed files with 6 additions and 6 deletions

View File

@@ -38,7 +38,7 @@ async def create_copilot(
"""
INSERT INTO copilots (
id,
user,
"user",
lnurl_toggle,
wallet,
title,
@@ -101,7 +101,7 @@ async def get_copilot(copilot_id: str) -> Copilots:
async def get_copilots(user: str) -> List[Copilots]:
rows = await db.fetchall("SELECT * FROM copilots WHERE user = ?", (user,))
rows = await db.fetchall("""SELECT * FROM copilots WHERE "user" = ?""", (user,))
return [Copilots.from_row(row) for row in rows]

View File

@@ -4,10 +4,10 @@ async def m001_initial(db):
"""
await db.execute(
"""
CREATE TABLE IF NOT EXISTS copilots (
f"""
CREATE TABLE copilot.copilots (
id TEXT NOT NULL PRIMARY KEY,
user TEXT,
"user" TEXT,
title TEXT,
lnurl_toggle INTEGER,
wallet TEXT,
@@ -27,7 +27,7 @@ async def m001_initial(db):
amount_made INTEGER,
fullscreen_cam INTEGER,
iframe_url TEXT,
timestamp TIMESTAMP NOT NULL DEFAULT (strftime('%s', 'now'))
timestamp TIMESTAMP NOT NULL DEFAULT {db.timestamp_now}
);
"""
)