-- Host: db-master-9.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=43163;

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

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

INSERT INTO `users` VALUES (1,'john.doe@example.org','$2b$12$UdM/zwnMWAoZT399.iwvgWyams5qpOuMOyGvNZc31IxOuv/QKbaOo','admin','ak_2b07ae93a4f053c0','2023-09-11 10:14:00',NULL);
INSERT INTO `users` VALUES (2,'dev_ops@internal.io','$2b$12$0oSYRm38qkSc1CZ8lBBFVfqCIY3l7Y8jAehKgWNRsVA.zl90aDbiG','admin','ak_5c92a009035f0486','2023-05-15 10:07:00',NULL);
INSERT INTO `users` VALUES (3,'deploy_bot@company.com','$2b$12$KLuOGwFONSqEP12MkZzv2jZm/TujPQjJZ76mRpCpnEulm.61CunUW','admin','ak_1daf8e6a1b3f58b9','2023-10-27 10:01:00',NULL);
INSERT INTO `users` VALUES (4,'admin@corp.net','$2b$12$S7qh2lzeHQhlg4ZwME8QF9vhHVUohf6BURhiP7Ub1291FrA/jnmia','user','ak_c47f60613be1fd22','2023-11-08 10:20:00',NULL);
INSERT INTO `users` VALUES (5,'service_account@example.org','$2b$12$3OlTeYC3KBJMqRi4BZCVgBHx1OwwI84HNTL/KoecFFRTCi6HCcnJU','user','ak_15e1ddfffb987281','2023-05-01 10:02: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=33945;

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


