Added ability to fetch products from the database
This commit is contained in:
@ -9,11 +9,13 @@ CREATE TABLE IF NOT EXISTS Users (
|
||||
role TEXT NOT NULL
|
||||
);
|
||||
|
||||
-- INSERT INTO Users (first_name, last_name, email, phone, password) VALUES ("Luke", "Else", "test@test.com", "07498 289321", "test213");
|
||||
INSERT INTO Users (first_name, last_name, username, email, phone, password, role) VALUES ("Luke", "Else", "lukejelse04", "test@test.com", "07498 289321", "test213", "Customer");
|
||||
|
||||
CREATE TABLE IF NOT EXISTS Products (
|
||||
id INTEGER PRIMARY KEY,
|
||||
name TEXT NOT NULL,
|
||||
image TEXT NOT NULL,
|
||||
description TEXT NOT NULL,
|
||||
cost DECIMAL NOT NULL,
|
||||
sellerID INTEGER NOT NULL
|
||||
REFERENCES Users (id)
|
||||
@ -22,6 +24,17 @@ CREATE TABLE IF NOT EXISTS Products (
|
||||
category TEXT NOT NULL
|
||||
);
|
||||
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, category) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, "CarParts");
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, category) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, "CarParts");
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, category) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, "CarParts");
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, category) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, "CarParts");
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, category) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, "CarParts");
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, category) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, "CarParts");
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, category) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, "CarParts");
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, category) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, "CarParts");
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, category) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, "CarParts");
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, category) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, "CarParts");
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, category) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, "CarParts");
|
||||
|
||||
CREATE TABLE IF NOT EXISTS Orders (
|
||||
id INTEGER PRIMARY KEY,
|
||||
|
Reference in New Issue
Block a user