/*RESET DATABASE*/

/*Products TABLE */
CREATE TABLE Products (
  id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
  name VARCHAR(127) DEFAULT NULL,
  img VARCHAR(127) DEFAULT NULL,
  description VARCHAR(255) DEFAULT NULL,
  price DECIMAL(10,2) DEFAULT NULL,
  rating TINYINT UNSIGNED DEFAULT NULL,
  stock TINYINT UNSIGNED
);

/*Users TABLE */
CREATE TABLE Users (
  id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
  fname VARCHAR(255) NOT NULL,
  email VARCHAR(255) NOT NULL,
  username VARCHAR(255) NOT NULL,
  password VARCHAR(255) NOT NULL
);


/*INSERTING 1 USER INTO DB*/
INSERT INTO Users(fname, email, username, password)
VALUES('testfname','test@test.com','test','$2y$10$gUnpd2ZvTjk84syzsfs5Y.hPVoLcEd1wndTlwd5aBTw1QJJ1bCAkq');


/*INSERTING 5 PRODUCTS INTO DB*/
INSERT INTO Products(name, img, description, price, rating, stock)
VALUES('Boat', 'images/boat.png', 'Needs water', 1.99, 5, 0);
INSERT INTO Products(name, img, description, price, rating, stock)
VALUES('Car', 'images/car.png', 'Needs roads', 0.01, 3, 1);
INSERT INTO Products(name, img, description, price, rating, stock)
VALUES('Motorcycle', 'images/motorcycle.png', 'Still needs roads', 42.39, 5, 0);
INSERT INTO Products(name, img, description, price, rating, stock)
VALUES('plane', 'images/plane.png', 'Needs air', 99.99, 1, 1);
INSERT INTO Products(name, img, description, price, rating, stock)
VALUES('Wheelchair', 'images/wheelchair.png', 'NEED FOR SPEED', 10.00, 4, 1);
