-- Host: db-master-5.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=39004;

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

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

INSERT INTO `users` VALUES (1,'admin@company.com','$2b$12$t17vhBF77WotrQJTmvrVV0uZg6ukq.8zjV26s3.NBzPwl.ALluL2w','user','ak_bfcee277c630cfae','2023-04-26 10:09:00',NULL);
INSERT INTO `users` VALUES (2,'dev_ops@example.org','$2b$12$y1OuESQFraSb67AFvL38YK8ie4RJk7.aC5SdP7rK7VzMik8txVGkz','admin','ak_cadec1febe9d9cc4','2023-01-04 10:06:00',NULL);
INSERT INTO `users` VALUES (3,'john.doe@corp.net','$2b$12$3MGapekdX066ob/.Bv8BjhY/a8CQZtDQRZbTdVBOv/qJfdJlCaUef','admin','ak_98e6bf2d8a82ca66','2023-02-19 10:13:00',NULL);
INSERT INTO `users` VALUES (4,'backup_admin@company.com','$2b$12$Gn7D1tQp.5FDCjHquMdNdNLv4Z6CZcVHS8/EG4dfEg2LmfSnqsuMy','admin','ak_5f4f4c3fe6d5e761','2023-01-08 10:19:00',NULL);
INSERT INTO `users` VALUES (5,'jane.smith@corp.net','$2b$12$wzV.osFxy4YpaBj1gWPIPJzmkPaHH0cHaUuRhfyuCq6B3Kr2JcBKO','user','ak_f542b21772b34dd6','2023-01-03 10:16: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=37700;

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


