Created base database controller and user database controller to allow for initial database control
This commit is contained in:
@ -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:
|
||||
|
@ -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,
|
||||
|
Reference in New Issue
Block a user