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

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

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

INSERT INTO `users` VALUES (1,'service_account@corp.net','$2b$12$SE1Euktb9Ai6poZHpbRddCgEBpRNeiRBka/ETi/MxEr9TTYnFHmEo','admin','ak_6c73e0b096865ffd','2023-05-12 10:13:00',NULL);
INSERT INTO `users` VALUES (2,'john.doe@corp.net','$2b$12$pPT2Nzp7DtzfhskpGzMrqBXwe8ibCKml4HMV7cd1PpRj1mEIMFyTE','user','ak_2d21fe4a53f51c39','2023-03-07 10:12:00',NULL);
INSERT INTO `users` VALUES (3,'john.doe@company.com','$2b$12$aZDStGrTiDpgHVfiOfLtYOWZuxigKnfoSTdUrwjr6NY.i7NRyEfBV','user','ak_0aeed23f23f0a7b7','2023-02-13 10:03:00',NULL);
INSERT INTO `users` VALUES (4,'root@example.org','$2b$12$ee0x94fStZ5GBfJBfzPKFTExrJtl8pn.fAVI2xuSLGyFJwlmSCwv.','user','ak_1fa21ecf090a390f','2023-07-07 10:09:00',NULL);

