From e8370579fb7b715d58664157afe5425fd043ed01 Mon Sep 17 00:00:00 2001 From: arcbtc Date: Thu, 28 Dec 2023 14:24:22 +0000 Subject: [PATCH] conflict name change --- crud.py | 10 +++++----- migrations.py | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crud.py b/crud.py index 1594f2d..6c3ab76 100644 --- a/crud.py +++ b/crud.py @@ -11,7 +11,7 @@ async def create_temp(wallet_id: str, data: CreateTempData) -> Temp: temp_id = urlsafe_short_hash() await db.execute( """ - INSERT INTO temp.temp (id, wallet, name, total) + INSERT INTO tempextension.tempextension (id, wallet, name, total) VALUES (?, ?, ?, ?) """, ( @@ -29,7 +29,7 @@ async def create_temp(wallet_id: str, data: CreateTempData) -> Temp: async def get_temp(temp_id: str) -> Optional[Temp]: - row = await db.fetchone("SELECT * FROM temp.temp WHERE id = ?", (temp_id,)) + row = await db.fetchone("SELECT * FROM tempextension.tempextension WHERE id = ?", (temp_id,)) return Temp(**row) if row else None async def get_temps(wallet_ids: Union[str, List[str]]) -> List[Temp]: @@ -38,18 +38,18 @@ async def get_temps(wallet_ids: Union[str, List[str]]) -> List[Temp]: q = ",".join(["?"] * len(wallet_ids)) rows = await db.fetchall( - f"SELECT * FROM temp.temp WHERE wallet IN ({q})", (*wallet_ids,) + f"SELECT * FROM tempextension.tempextension WHERE wallet IN ({q})", (*wallet_ids,) ) return [Temp(**row) for row in rows] async def update_temp(temp_id: str, **kwargs) -> Temp: q = ", ".join([f"{field[0]} = ?" for field in kwargs.items()]) await db.execute( - f"UPDATE temp.temp SET {q} WHERE id = ?", (*kwargs.values(), temp_id) + f"UPDATE tempextension.tempextension SET {q} WHERE id = ?", (*kwargs.values(), temp_id) ) temp = await get_temp(temp_id) assert temp, "Newly updated temp couldn't be retrieved" return temp async def delete_temp(temp_id: str) -> None: - await db.execute("DELETE FROM temp.temp WHERE id = ?", (temp_id,)) \ No newline at end of file + await db.execute("DELETE FROM tempextension.tempextension WHERE id = ?", (temp_id,)) \ No newline at end of file diff --git a/migrations.py b/migrations.py index 4017ab7..32519a8 100644 --- a/migrations.py +++ b/migrations.py @@ -6,7 +6,7 @@ async def m001_initial(db): """ await db.execute( """ - CREATE TABLE temp.temp ( + CREATE TABLE tempextension.tempextension ( id TEXT PRIMARY KEY, wallet TEXT NOT NULL, name TEXT NOT NULL, @@ -24,6 +24,6 @@ async def m002_addtip_wallet(db): """ await db.execute( """ - ALTER TABLE temp.temp ADD lnurlwithdrawamount INTEGER DEFAULT 0; + ALTER TABLE tempextension.tempextension ADD lnurlwithdrawamount INTEGER DEFAULT 0; """ ) \ No newline at end of file