From 66b0ffeb7b730451e91717687a8b97b4a8263a5a Mon Sep 17 00:00:00 2001 From: Amritach222 <47746651+Amritach222@users.noreply.github.com> Date: Wed, 14 Oct 2020 00:52:34 +0545 Subject: [PATCH] Update create_db.py --- cgi-bin/create_db.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cgi-bin/create_db.py b/cgi-bin/create_db.py index b9667a572..a23679923 100644 --- a/cgi-bin/create_db.py +++ b/cgi-bin/create_db.py @@ -9,15 +9,19 @@ def create_db(): assert not os.path.exists(DB_FILE) + #connecting to database (con, cur) = db_connect() + # SQL Query for creating table cur.execute('''CREATE TABLE query_log (id INTEGER PRIMARY KEY, - post_date TEXT, - ip_addr TEXT, - user_agent TEXT, - input_script TEXT, + post_date TEXT NOT NULL, + ip_addr TEXT NOT NULL, + user_agent TEXT NOT NULL, + input_script TEXT NOT NULL, had_error INTEGER)''') + #Execute query con.commit() + #close database connection cur.close() if __name__ == "__main__":