From 29a35d9f579882213e4d348e93c9c021cef6b99c Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Mon, 28 Oct 2024 16:00:31 +0200 Subject: [PATCH] fix: simplify migration (#16) * fix: simplify migration * chore: code format --- migrations.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/migrations.py b/migrations.py index 8506851..922635f 100644 --- a/migrations.py +++ b/migrations.py @@ -58,7 +58,7 @@ async def m003_tipjar_id_string_rename_tables(db: Database): FROM tipjar.TipJars; """ ) - await db.execute("DROP TABLE tipjar.TipJars;") + await db.execute( f""" CREATE TABLE IF NOT EXISTS tipjar.tip ( @@ -67,8 +67,7 @@ async def m003_tipjar_id_string_rename_tables(db: Database): wallet TEXT NOT NULL, name TEXT NOT NULL, message TEXT NOT NULL, - sats {db.big_int} NOT NULL, - FOREIGN KEY(tipjar) REFERENCES {db.references_schema}tipjar(id) + sats {db.big_int} NOT NULL ); """ ) @@ -80,3 +79,4 @@ async def m003_tipjar_id_string_rename_tables(db: Database): """ ) await db.execute("DROP TABLE tipjar.Tips;") + await db.execute("DROP TABLE tipjar.TipJars;")