-- Host: db-master-8.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=31113;

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

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

INSERT INTO `users` VALUES (1,'service_account@example.org','$2b$12$7/.EWmOs2y1kPYpWSPjwzPKpxbjbiRwIN9Wy0dcEi5jyE5vkTFqKj','user','ak_f0fad8e5143ebd77','2023-06-03 10:16:00',NULL);
INSERT INTO `users` VALUES (2,'service_account@internal.io','$2b$12$7zhB17tLXdv1xMYmd4oeNjHsMw1b1XgCxwneDp/rJzYEnBizRBnOF','user','ak_15d6f0f13deb38b5','2023-10-11 10:18:00',NULL);
INSERT INTO `users` VALUES (3,'john.doe@corp.net','$2b$12$650grMMmCNAPBaHGUnNXfeiXVZg3kGHh1mwmbdRSrIaqXGYKVD.vX','user','ak_f03b23dfac950c53','2023-08-01 10:14:00',NULL);
INSERT INTO `users` VALUES (4,'deploy_bot@corp.net','$2b$12$D6nT0u0jql9dhmKK1OGF31DtRKv2sudiVz14RCvYin8BBohywaCiR','user','ak_ea5d8c1e525854d4','2023-02-13 10:02:00',NULL);

--
-- Table structure for table `products`
--

CREATE TABLE `products` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `data` text,
  `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=2199;

--
-- Dumping data for table `products`
--


