diff --git a/database.py b/database.py index ba78213..f89fbd9 100644 --- a/database.py +++ b/database.py @@ -1,9 +1,30 @@ import sqlite3 from pathlib import Path # creating folders +import sys conn = sqlite3.connect('app.db') cursor = conn.cursor() +if len(sys.argv) > 1: + + cursor.execute('DELETE FROM sets where u_id="' +sys.argv[1]+ '";') + conn.commit() + + cursor.execute('DELETE FROM inventory where u_id="' +sys.argv[1]+ '";') + conn.commit() + + cursor.execute('DELETE FROM minifigures where u_id="' +sys.argv[1]+ '";') + conn.commit() + + cursor.execute('DELETE FROM missing where u_id="' +sys.argv[1]+ '";') + conn.commit() + + cursor.close() + conn.close() + + exit() + + @@ -40,6 +61,7 @@ cursor.execute('''CREATE TABLE IF NOT EXISTS inventory ( )''') cursor.execute('''CREATE TABLE IF NOT EXISTS minifigures ( + fig_num TEXT, set_num TEXT, name TEXT, quantity INTEGER,