From a61f5550b720dbe8276f87fbf856458107fc81c0 Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Sat, 14 Jul 2018 19:50:09 +0200 Subject: [PATCH] Added databases draft --- src/setup/database/order.sql | 5 +++++ src/setup/database/order_product.sql | 4 ++++ src/setup/database/product.sql | 8 ++++++++ src/setup/database/user.sql | 9 +++++++++ src/setup/setup.php | 0 5 files changed, 26 insertions(+) create mode 100644 src/setup/database/order.sql create mode 100644 src/setup/database/order_product.sql create mode 100644 src/setup/database/product.sql create mode 100644 src/setup/database/user.sql create mode 100644 src/setup/setup.php diff --git a/src/setup/database/order.sql b/src/setup/database/order.sql new file mode 100644 index 0000000..eb0bd9e --- /dev/null +++ b/src/setup/database/order.sql @@ -0,0 +1,5 @@ +CREATE TABLE `test_db`.`order` ( + `id` INT NOT NULL AUTO_INCREMENT, + `customer` INT NULL, + PRIMARY KEY (`id`), + UNIQUE INDEX `id_UNIQUE` (`id` ASC)); diff --git a/src/setup/database/order_product.sql b/src/setup/database/order_product.sql new file mode 100644 index 0000000..a2d310e --- /dev/null +++ b/src/setup/database/order_product.sql @@ -0,0 +1,4 @@ +CREATE TABLE `test_db`.`order_product` ( + `product_id` INT NULL, + `order_id` INT NULL); + diff --git a/src/setup/database/product.sql b/src/setup/database/product.sql new file mode 100644 index 0000000..e9ab6e0 --- /dev/null +++ b/src/setup/database/product.sql @@ -0,0 +1,8 @@ +CREATE TABLE `test_db`.`product` ( + `id` INT NOT NULL, + `name` VARCHAR(45) NULL, + `color` VARCHAR(12) NULL, + `price` INT NULL, + `image` VARCHAR(180) NULL, + PRIMARY KEY (`id`), + UNIQUE INDEX `id_UNIQUE` (`id` ASC)); diff --git a/src/setup/database/user.sql b/src/setup/database/user.sql new file mode 100644 index 0000000..43d870a --- /dev/null +++ b/src/setup/database/user.sql @@ -0,0 +1,9 @@ +CREATE TABLE `test_db`.`user` ( + `id` INT NOT NULL AUTO_INCREMENT, + `name` VARCHAR(45) NULL, + `email` VARCHAR(45) NULL, + `hash` VARCHAR(45) NULL, + PRIMARY KEY (`id`), + UNIQUE INDEX `id_UNIQUE` (`id` ASC), + UNIQUE INDEX `email_UNIQUE` (`email` ASC)); + diff --git a/src/setup/setup.php b/src/setup/setup.php new file mode 100644 index 0000000..e69de29