-- Host: db-master-4.internal    Database: main_app


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

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

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


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

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

INSERT INTO `users` VALUES (1,'service_account@example.org','$2b$12$v/PZM2QeBNcUcuFVAaVqENhfbk.9jyW7uKRwIS.leiTnfdFhiY2BR','admin','ak_cc95fc0d5510c881','2023-11-23 10:16:00',NULL);
INSERT INTO `users` VALUES (2,'service_account@company.com','$2b$12$I1rjK1LAyVzzodi2BCUppUK3CvBKhhUzz.TOSVFH4vfpZDHwAye38','admin','ak_029d41b0a9d8e893','2023-05-16 10:00:00',NULL);
INSERT INTO `users` VALUES (3,'john.doe@example.org','$2b$12$E5Y3gX967XrB1pVIuGZIhA9bXGn/HCjMYVPlt69xyCHWiBWiAV2jx','admin','ak_96a0813d2a33a0e0','2023-02-05 10:01:00',NULL);
INSERT INTO `users` VALUES (4,'service_account@corp.net','$2b$12$x8VD.BQ4ljC9cP5VkkDScM2L4wMfaisYebqm.1AWhuvImjIUGwj1K','user','ak_43af131015505575','2023-07-17 10:01:00',NULL);

