TEST

Tables (5)

cart_items

  • id — uuid — Primary key — NOT NULL
  • clerk_id — text — NOT NULL
  • product_id — uuid — NOT NULL
  • quantity — integer — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

order_items

  • id — uuid — Primary key — NOT NULL
  • order_id — uuid — NOT NULL
  • product_id — uuid — NOT NULL
  • product_name — text — NOT NULL
  • quantity — integer — NOT NULL
  • price — numeric — NOT NULL
  • created_at — timestamp — NOT NULL

orders

  • id — uuid — Primary key — NOT NULL
  • clerk_id — text — NOT NULL
  • total_amount — numeric — NOT NULL
  • status — text — NOT NULL
  • shipping_address — jsonb
  • order_note — text
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL
  • id (id2) — uuid — Foreign key → order_items.id — NOT NULL

products

  • id — uuid — Primary key — NOT NULL
  • name — text — NOT NULL
  • price — numeric — NOT NULL
  • description — text
  • image_url — text
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL
  • category — text — NOT NULL
  • stock_quantity — numeric
  • is_active — boolean
  • id (id2) — uuid — Foreign key → cart_items.id — NOT NULL
  • id (id3) — uuid — Foreign key → order_items.id — NOT NULL

users

  • id — uuid — NOT NULL
  • clerk_id — text — NOT NULL
  • name — text — NOT NULL
  • created_at — timestamp — NOT NULL