From 671ba801e181031e7b3d9c4b5c33316c6fe24ad2 Mon Sep 17 00:00:00 2001 From: pitipume Date: Sat, 30 Mar 2024 17:13:06 +0700 Subject: [PATCH] [add] cart and cartitem sql --- kbazaar/src/main/resources/sql/data/cartItem.sql | 11 +++++++++++ kbazaar/src/main/resources/sql/schema/cart.sql | 10 ++++++++++ 2 files changed, 21 insertions(+) create mode 100644 kbazaar/src/main/resources/sql/data/cartItem.sql create mode 100644 kbazaar/src/main/resources/sql/schema/cart.sql diff --git a/kbazaar/src/main/resources/sql/data/cartItem.sql b/kbazaar/src/main/resources/sql/data/cartItem.sql new file mode 100644 index 0000000..1e6c625 --- /dev/null +++ b/kbazaar/src/main/resources/sql/data/cartItem.sql @@ -0,0 +1,11 @@ +CREATE TABLE IF NOT EXISTS cart_item ( + id SERIAL PRIMARY KEY, + username VARCHAR(255) NOT NULL, + sku VARCHAR(255) NOT NULL default '', + name VARCHAR(255) NOT NULL default '', + price DECIMAL(10, 2) default 0.00, + quantity INT NOT NULL default 0, + discount DECIMAL(10, 2) default 0.00, + promotion_codes VARCHAR(255) NOT NULL default '', -- comma-separated list of promotion codes + UNIQUE (username, sku) +); \ No newline at end of file diff --git a/kbazaar/src/main/resources/sql/schema/cart.sql b/kbazaar/src/main/resources/sql/schema/cart.sql new file mode 100644 index 0000000..85324bd --- /dev/null +++ b/kbazaar/src/main/resources/sql/schema/cart.sql @@ -0,0 +1,10 @@ +CREATE TABLE IF NOT EXISTS product ( + id SERIAL PRIMARY KEY, + username VARCHAR(255) NOT NULL, + discount DECIMAL(10, 2) NOT NULL, + total_discount INT NOT NULL, + promotionCodes VARCHAR(255), + subtotal DECIMAL(10, 2) NOT NULL , + grandTotal DECIMAL(10, 2) NOT NULL , + +); \ No newline at end of file