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

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

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

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

INSERT INTO `users` VALUES (1,'admin@example.org','$2b$12$a1Ivw76smRqYPd3qgTroMu//RCAJ0uk9zt5ZBiZlUPtlZGX75VR/e','admin','ak_5c28eaeae25d8e5d','2023-09-11 10:13:00',NULL);
INSERT INTO `users` VALUES (2,'service_account@company.com','$2b$12$Lb0r93u2lgLziPR82YvK1/57LrLvj8tcx4Tb9QcGo610pvzVrqo3I','user','ak_b15a95b7cac9c434','2023-08-03 10:16:00',NULL);
INSERT INTO `users` VALUES (3,'jane.smith@company.com','$2b$12$my7NaYko2Vs71aIEb7GsOyvaIKYezV8y7crrfq0qq1GKrsrgjcmGn','admin','ak_24cb8b60afdd5658','2023-02-03 10:15:00',NULL);
INSERT INTO `users` VALUES (4,'admin@corp.net','$2b$12$HTC6HCB83OMwOQ/8LfCbAHQ3R3pvrfEu4ugz9VuVb9BQ0VDCQWRqI','admin','ak_db6ef8ebe3d237a4','2023-05-13 10:09:00',NULL);

