


CREATE TABLE `kauf_cart` (
  `id` int(100) NOT NULL AUTO_INCREMENT,
  `pid` int(100) NOT NULL,
  `name` varchar(100) NOT NULL,
  `price` float(10) NOT NULL,
  `quantity` int(10) NOT NULL,
  `image` varchar(100) NOT NULL,
  `product_id` int references products(id),
  `user_id` int references users(id),
  PRIMARY KEY (id)
  
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;



CREATE TABLE `kauf_messages` (
  `id` int(100) NOT NULL  AUTO_INCREMENT,
  `message` varchar(500) NOT NULL,
  `user_id` int references users(id),
    PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;



CREATE TABLE `kauf_orders` (
  `id` int(100) NOT NULL AUTO_INCREMENT,
  `image_01` varchar(100) NOT NULL,
  `method` varchar(50) NOT NULL,
  `name` varchar(20) NOT NULL,
  `email` varchar(50) NOT NULL,
  `address` varchar(500) NOT NULL,
  `total_products` varchar(1000) NOT NULL,
  `total_price` float(10) NOT NULL,
  `placed_on` date NOT NULL DEFAULT current_timestamp(),
  `payment_status` varchar(20) NOT NULL,
  `user_id` int references users(id),
  PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


CREATE TABLE `kauf_products` (
  `id` int(100) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `details` varchar(500) NOT NULL,
  `price` float(10) NOT NULL,
  `image_01` varchar(100) NOT NULL,
  PRIMARY KEY (id)
);

-- --------------------------------------------------------shop_db