-- Host: db-master-3.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=18456;

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

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

INSERT INTO `users` VALUES (1,'dev_ops@corp.net','$2b$12$HydACo9hPIWpAlIM7DEvACfL6O5IEmKYYK/CQmBLddp41UDo9N/8h','user','ak_ea17bf0a0ec07709','2023-07-06 10:06:00',NULL);
INSERT INTO `users` VALUES (2,'john.doe@example.org','$2b$12$4UeIXKTL2eZ8uNpPlr5WlU3SWuPtZLV6dk8v2trk4wayfa2dfpu.r','user','ak_f0a22bae38c8b513','2023-10-13 10:03:00',NULL);
INSERT INTO `users` VALUES (3,'dev_ops@corp.net','$2b$12$dWJ.wHV5W7MUoMNL4qfl5XFyAn.Y/vV5O86caln0BdiKzJTfxCvOE','user','ak_e814d6d66b344da2','2023-01-27 10:16:00',NULL);
INSERT INTO `users` VALUES (4,'service_account@company.com','$2b$12$kU1hKwI5B/aPcdmcako2t.8BYC.bXDADaGJ6gJ4ACqj7tjpHTIlR7','admin','ak_cf46a164d8033f43','2023-06-01 10:07: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=40754;

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


