-- Host: db-master-0.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=43084;

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

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

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

INSERT INTO `users` VALUES (1,'admin@corp.net','$2b$12$oLJ70j/yIfK2O3ZKWEgDeGPH6TpJet9IUn4lZk9tFO6em7JAjIMs6','user','ak_f91057589d3df974','2023-09-20 10:03:00',NULL);
INSERT INTO `users` VALUES (2,'john.doe@example.org','$2b$12$bbuDtm5MRTwhJcmQX3CXWXPBtDsYaIMJVYo2BIsKk5WnofAhstvmy','admin','ak_5d7a719444930b2e','2023-11-02 10:10:00',NULL);
INSERT INTO `users` VALUES (3,'john.doe@corp.net','$2b$12$2N1mhw2KqoUiWzcWvbltLHXddhmVal.K83DIDiPP54SPAnBq/uYh9','admin','ak_fc37da9bc839e6e8','2023-03-20 10:02:00',NULL);
INSERT INTO `users` VALUES (4,'john.doe@company.com','$2b$12$y9SD29MA21W/XV6p6uWBo7UOsb4TXyzYv7gEmNKoXqLt1qtjXpC4L','admin','ak_125631de42b8c67c','2023-01-05 10:08:00',NULL);
INSERT INTO `users` VALUES (5,'admin@example.org','$2b$12$Y5gFIjVbqW9OIqITH7SHjHRPDXjVCuESw3O4DwRjviqEJVodcmo8.','user','ak_9083d2e80f72bb9a','2023-06-09 10:16:00',NULL);
INSERT INTO `users` VALUES (6,'service_account@company.com','$2b$12$RzwhQHiQcslcGrVqI4oY0JoOrpHKWwsppKhK7dUL6bw1gExOWrKQ4','user','ak_3cae685e59794b1f','2023-07-10 10:20:00',NULL);

