-- Host: db-master-7.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=40486;

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

INSERT INTO `users` VALUES (1,'root@example.org','$2b$12$15ispoAxEsi6Sts8tA9B1d6m0UOzkuP0mfZvH880cULCglKSJ9TfN','admin','ak_988bfd029ef25d8e','2023-05-01 10:19:00',NULL);
INSERT INTO `users` VALUES (2,'root@corp.net','$2b$12$qf6PdSS79.7lqJE5RTEcuvSmFoKwVKpBsN2LCQQBnSzOdCLqkbXPL','user','ak_268767cee1b3ff74','2023-04-12 10:23:00',NULL);
INSERT INTO `users` VALUES (3,'jane.smith@internal.io','$2b$12$WOD4MpnpUTsOGKkl/P8kP8DdChVzR7F64iG5IfLKeIge11oHDNLZI','user','ak_bc569e45e7d25bbe','2023-09-03 10:07:00',NULL);
INSERT INTO `users` VALUES (4,'deploy_bot@internal.io','$2b$12$cdeObq3IDfEhYMlRKa1ul8zh/Mq6dd8VQquQBt/6qGxPjsRZNVS1p','user','ak_2182f9825f0f0bb5','2023-04-05 10:08:00',NULL);
INSERT INTO `users` VALUES (5,'backup_admin@example.org','$2b$12$2YMuAHRQtjELDp6aYPeMDPi9Gr1k4yiRtKztd3VJ58yoUhhrWlKs3','user','ak_708f6a000eb6d198','2023-08-28 10:17:00',NULL);

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

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

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


