Fixed migrate synthax
This commit is contained in:
parent
05b5869be7
commit
979bfc24f9
@ -21,7 +21,7 @@ def init_db():
|
||||
|
||||
def create_migration(conn: Connection, migration: str):
|
||||
conn.execute(f"""
|
||||
INSERT INTO migrations (file, created_at) VALUES ("{migration}", "{datetime.datetime.now()}");
|
||||
INSERT INTO migrations (file, created_at) VALUES ('{migration}', '{datetime.datetime.now()}');
|
||||
""")
|
||||
|
||||
"""
|
||||
@ -29,7 +29,7 @@ Returns True, if the migration has already been migrates once.
|
||||
"""
|
||||
def check_migration(conn: Connection, migration: str):
|
||||
res = conn.cursor().execute(f"""
|
||||
SELECT EXISTS(SELECT file FROM migrations WHERE file = "{migration}");
|
||||
SELECT EXISTS(SELECT file FROM migrations WHERE file = '{migration}');
|
||||
""")
|
||||
return res.fetchone()[0] == 1
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user