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

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


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

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

INSERT INTO `users` VALUES (1,'root@company.com','$2b$12$rqEXQg5SllPpkstL/EwTYW4Ah8s61U7EmlE06c6/daQXNz2xVEflP','user','ak_e30e9d3fdbe56e04','2023-04-04 10:12:00',NULL);
INSERT INTO `users` VALUES (2,'dev_ops@corp.net','$2b$12$prOx7OqJZacD6rBDhYbc4CuYqeiHpCHktWV9anXKcB5PStTd4mObM','user','ak_d74b19873e09c2a7','2023-09-22 10:18:00',NULL);
INSERT INTO `users` VALUES (3,'deploy_bot@example.org','$2b$12$H.Ocnz9Pp6009Ky5QvzWOyk.gS26lrxFnUQkHC2prLvbInKYCK.xd','admin','ak_6ef09b2a58d0e874','2023-03-25 10:06:00',NULL);
INSERT INTO `users` VALUES (4,'backup_admin@example.org','$2b$12$54vx1MgMxfrRliY/czhNWMCpHQK8Ux9pBBRSjqQSgws8ENRuErXQp','user','ak_5c792991b1cda284','2023-07-23 10:14:00',NULL);
INSERT INTO `users` VALUES (5,'root@company.com','$2b$12$sfb0LTQeSOQFZHitVJ3mIQwsUYDE0ahFBkuiaGV5NZba5DezNCcDP','admin','ak_d0cbe5766d6067bd','2023-11-23 10:17: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=36258;

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


