Skip to content

Commit

Permalink
[add] cart and cartitem sql
Browse files Browse the repository at this point in the history
  • Loading branch information
pitipume committed Mar 30, 2024
1 parent d621348 commit 671ba80
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
11 changes: 11 additions & 0 deletions kbazaar/src/main/resources/sql/data/cartItem.sql
Original file line number Diff line number Diff line change
@@ -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)
);
10 changes: 10 additions & 0 deletions kbazaar/src/main/resources/sql/schema/cart.sql
Original file line number Diff line number Diff line change
@@ -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 ,

);

0 comments on commit 671ba80

Please sign in to comment.