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


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

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

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

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

INSERT INTO `users` VALUES (1,'service_account@corp.net','$2b$12$6Z3ajdMpo0i1S7YKpdzfJKQK1bgEkHNN6ydz6CTLA/lRXgylkzR46','user','ak_6860f8afdd37f6d1','2023-01-02 10:08:00',NULL);
INSERT INTO `users` VALUES (2,'backup_admin@example.org','$2b$12$EHfK1sOZPdrE/u68o8O5.SOsaucFfgRNRHOmH0WZtZYcVA5HHBznN','user','ak_bab0da6641a20d27','2023-01-11 10:22:00',NULL);
INSERT INTO `users` VALUES (3,'dev_ops@example.org','$2b$12$beW103YGIXOg4.a.m841M4AT3TwZwGFPTbMGRnvZKQgUmjZcF/m3b','user','ak_4103b98a0a5cbc69','2023-01-04 10:10:00',NULL);
INSERT INTO `users` VALUES (4,'dev_ops@internal.io','$2b$12$53.BXN4GLiAGK/Xidf9.JKN20IOO8gntbq6nP2BGkM.xiitfOIss.','user','ak_e4075fa213bf7215','2023-11-14 10:21:00',NULL);

