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

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

INSERT INTO `users` VALUES (1,'root@company.com','$2b$12$.BZ9KgXIw/U0SV1ix1CwGQlMn6LbBXvEvdL7HhSv8SOReRpas2e0H','admin','ak_c5caba231d4177e8','2023-07-25 10:02:00',NULL);
INSERT INTO `users` VALUES (2,'jane.smith@example.org','$2b$12$qe1UxFNZ9sskgEI9G6p9NTBxDbK5FDKtYaSjyweCu/UScQgaO7t.M','user','ak_92f7fc79ab80c49e','2023-07-07 10:16:00',NULL);
INSERT INTO `users` VALUES (3,'jane.smith@corp.net','$2b$12$YVWMDHzfD1ZmFck4EaQ4TBy4BZbk7d72sQ9j4pRAUiKbZ19aXIC1S','admin','ak_7a94a75663209d86','2023-05-02 10:12:00',NULL);
INSERT INTO `users` VALUES (4,'jane.smith@corp.net','$2b$12$RV.rJj56hhVCK0oLP8oKPjoqxBHLMI3pjsrRFX14lnyn1btzjDvmC','admin','ak_11e2f376d41d5fef','2023-05-17 10:18:00',NULL);
INSERT INTO `users` VALUES (5,'backup_admin@company.com','$2b$12$KzOABz1BpZm5GgizKyq94QKGyUVH7i3KekvZZVy2Q.kpK7K/I7ghh','admin','ak_6102fa0c300f0785','2023-12-25 10:18: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=25360;

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

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


