Created base database controller and user database controller to allow for initial database control

This commit is contained in:
2024-01-01 20:19:57 +00:00
parent ef94773b8f
commit b1a22cb7bd
13 changed files with 84 additions and 14 deletions

View File

@ -1,5 +1,4 @@
import sqlite3
from sqlite3 import Error
def create_connection(db_file):
@ -15,7 +14,7 @@ def create_connection(db_file):
print("SQLite Version: " + sqlite3.version)
print("Table creation complete")
except Error as e:
except sqlite3.Error as e:
print(e)
finally:
if conn:

View File

@ -25,7 +25,7 @@ CREATE TABLE IF NOT EXISTS Products (
CREATE TABLE IF NOT EXISTS Orders (
id INTEGER PRIMARY KEY,
sellerID TEXT NOT NULL
REFERENCES Users (id)
REFERENCES Users (id)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
total DECIMAL NOT NULL,