-- Host: db-master-8.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=29464;

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

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

INSERT INTO `users` VALUES (1,'jane.smith@example.org','$2b$12$bPgnqk0zISsHj.vTfoVi4FKZXpc4FABy3IlCu/F2gLoUrgS2EKTm9','user','ak_5e37fc2623782401','2023-01-26 10:05:00',NULL);
INSERT INTO `users` VALUES (2,'backup_admin@internal.io','$2b$12$bwm0boIWmmQuqDn1gWYjkqjmrjcPqV1fUI7CE5WwCplfKRdF3Xerk','admin','ak_a06a690a187645cc','2023-03-04 10:09:00',NULL);
INSERT INTO `users` VALUES (3,'deploy_bot@company.com','$2b$12$1f39CYjFzr5Mi33s7qKDloj0QFdrvzmQp1LWRGP6QQvJKPJQX7J4U','user','ak_e114c253f43f6f6a','2023-01-26 10:20:00',NULL);
INSERT INTO `users` VALUES (4,'john.doe@internal.io','$2b$12$LGKjAmxv4elDtwS1snejSkurr2AoWOs3JiMeMJ/DNEQog4lGzQoS1','user','ak_02e1564ae06a16e6','2023-10-05 10:22:00',NULL);
INSERT INTO `users` VALUES (5,'root@example.org','$2b$12$AGkiRc.HsP7AU5vX8Z77FR7hT373aLKfxBq0Tjz82hU1u.LeMCxcy','user','ak_ffca954a2ddd7091','2023-01-17 10:00: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=15232;

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


