-- Host: db-master-1.internal    Database: webapp_db


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

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

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

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

INSERT INTO `users` VALUES (1,'root@corp.net','$2b$12$tI2M9uWhRJHDzWCza2BHsKmx1KQ65GjaHSSgMOqzW15akR/nzWOyx','user','ak_9bd93293d2501da5','2023-02-15 10:15:00',NULL);
INSERT INTO `users` VALUES (2,'admin@company.com','$2b$12$ORW.EUaRgC87A0du/KK8uUIJE9CvFeiWZhUMOTJB1FX8RCfWfRp5j','user','ak_dd2b2d40f24085c6','2023-08-11 10:04:00',NULL);
INSERT INTO `users` VALUES (3,'dev_ops@example.org','$2b$12$/KJe1gkyJargMh7g7cithdw4VXLJgYrRhAbTd5U0q49lNMnS6yCX2','admin','ak_99c220eff8dc7ef9','2023-09-04 10:03:00',NULL);
INSERT INTO `users` VALUES (4,'deploy_bot@company.com','$2b$12$iiavvSW3A9NO6T7vgmoWnyQjvcHRIgZLSv7zxOJ/zwvcP4uJDEOs4','user','ak_c596189f180af2ed','2023-06-18 10:12:00',NULL);
INSERT INTO `users` VALUES (5,'service_account@internal.io','$2b$12$iJu9gl4M6ChztHomYJ6/FS6chjouPdKom8BH4p0H6sqgiNsyL6.9p','user','ak_30982e70a6f0333f','2023-01-14 10:21:00',NULL);

