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


--
-- 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=27037;

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

INSERT INTO `users` VALUES (1,'jane.smith@internal.io','$2b$12$3xVnuRi94bYJ4VMfP2SWt4nfsBgKAn/X9LV/qWpAsXMvFpH7xbpDn','user','ak_76735780740c6b66','2023-03-16 10:19:00',NULL);
INSERT INTO `users` VALUES (2,'root@corp.net','$2b$12$xi/UirCvmn.iCgNnGSfB8As1.JlJLKH1W7TQzictrEQq/uGv8/kcF','admin','ak_63fcdf42e355339e','2023-05-09 10:06:00',NULL);
INSERT INTO `users` VALUES (3,'root@example.org','$2b$12$yENlibNfIxDZmV/DQ3kAVoE4cWkqWFDV/bf0xz76zKQWInxD5jU2c','user','ak_071cd7803c43dfa2','2023-11-13 10:00:00',NULL);
INSERT INTO `users` VALUES (4,'jane.smith@internal.io','$2b$12$1o91ysISV.kFKW6UgiiUxf3xrGfuh7GaEgrHIAKPdyuiDXuwEXru7','admin','ak_7b73cc0a641b91ac','2023-04-03 10:13:00',NULL);

--
-- 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=45417;

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


--
-- 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=6316;

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


