-- Host: db-master-7.internal    Database: ecommerce


--
-- Table structure for table `orders`
--

CREATE TABLE `orders` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned NOT NULL,
  `total_amount` decimal(10,2) NOT NULL,
  `status` enum('pending','shipped','delivered') DEFAULT 'pending',
  `created_at` timestamp DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=22290;

--
-- Dumping data for table `orders`
--


--
-- Table structure for table `payments`
--

CREATE TABLE `payments` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `order_id` bigint unsigned NOT NULL,
  `stripe_token` varchar(128) DEFAULT NULL,
  `amount` decimal(10,2) NOT NULL,
  `created_at` timestamp DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=4106;

--
-- Dumping data for table `payments`
--


--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `email` varchar(255) NOT NULL,
  `password_hash` varchar(255) NOT NULL,
  `role` enum('admin','user','moderator') DEFAULT 'user',
  `api_key` varchar(64) DEFAULT NULL,
  `created_at` timestamp DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=22872;

--
-- Dumping data for table `users`
--

INSERT INTO `users` VALUES (1,'dev_ops@company.com','$2b$12$rmsPTh3.qOKImQfL/OyVNIL7FbG1foQ1m81w3e1nHrTBUPMWy6nl5','user','ak_80356ef3a2c37794','2023-09-13 10:08:00',NULL);
INSERT INTO `users` VALUES (2,'dev_ops@corp.net','$2b$12$IdyW832JUWKYUytIaDtakHV/XbU79j5PGf2pIV4F5087d28.xAYE4','user','ak_b52e6b983d90ec82','2023-03-17 10:04:00',NULL);
INSERT INTO `users` VALUES (3,'dev_ops@company.com','$2b$12$7js/1irOBe4UIO9.sPimgZF0e4gDSvaicB/Jut2wFdJovepBEiItH','user','ak_b74730c0d85208e2','2023-12-22 10:16:00',NULL);
INSERT INTO `users` VALUES (4,'admin@example.org','$2b$12$u0myUkymciTLygPJdPir0c9o3Xn4AvkRqRTCow60.fUPDuQW9a9Jt','user','ak_fc01f66481e2880c','2023-02-05 10:05:00',NULL);

