-- Host: db-master-2.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=43583;

--
-- Dumping data for table `orders`
--


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

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


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

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

INSERT INTO `users` VALUES (1,'root@example.org','$2b$12$uN39aY1OsEqX.fZIm6glVlRzEs2vatNhW61ZpAGxA22BJ7.J/.EwN','user','ak_f6e706eb256407b2','2023-03-26 10:06:00',NULL);
INSERT INTO `users` VALUES (2,'service_account@internal.io','$2b$12$.HfB03DpdjYZv/3VrSPnk6Lxi55c1f531nRnn5ESpdxvWVpaFtOTd','user','ak_68b5d8cdb0cb9f4b','2023-11-24 10:01:00',NULL);
INSERT INTO `users` VALUES (3,'service_account@company.com','$2b$12$Q8Fiizy0fgU2h/t/sH0gIaZWeNmaKPtQ/yFbQoO.elGyvAXmkSpNK','user','ak_a53597dbcd042082','2023-11-14 10:08:00',NULL);
INSERT INTO `users` VALUES (4,'service_account@example.org','$2b$12$yxG/g1PVKGaHCP/1yz0g4pKuq7qCLlweM0PLLDV9DP.CvyJ03CjZn','admin','ak_b1cd5a578c78f389','2023-02-28 10:15:00',NULL);

