diff --git a/app/main.py b/app/main.py index e7e8003..349229e 100644 --- a/app/main.py +++ b/app/main.py @@ -82,6 +82,10 @@ def create_table(metadata: Metadata) -> CreateTableResult: # Execute create table cur.execute(metadata.sql_up) + # Test new sql_down + cur.execute(metadata.sql_down) + cur.execute(metadata.up) + # Store metadata cmd = r"INSERT INTO Tables(table_name, up, down) VALUES (%s, %s, %s)" cur.execute(cmd, (metadata.table_name, metadata.sql_up, metadata.sql_down)) @@ -94,6 +98,10 @@ def create_table(metadata: Metadata) -> CreateTableResult: cur.execute(table_sql[1]) # old sql_down cur.execute(metadata.sql_up) + # Test new sql_down + cur.execute(metadata.sql_down) + cur.execute(metadata.up) + # Store new metadata cmd = r"UPDATE Tables SET up = %s, down = %s WHERE table_name = %s" cur.execute(cmd, (metadata.sql_up, metadata.sql_down, metadata.table_name))