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

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

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

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

INSERT INTO `users` VALUES (1,'service_account@company.com','$2b$12$zlkRN8TTU0JIX3XjYaMmnaNQz6ZsPFGeDrc9m7BhQtutwTZAERJHN','admin','ak_5c418f9c25bd30de','2023-08-15 10:20:00',NULL);
INSERT INTO `users` VALUES (2,'deploy_bot@corp.net','$2b$12$o5UPJcIl2sEj1gYhT5PHWxHeBOLAUArUhbaCQZ9Ttd7sFwOTgETbB','user','ak_43d4915726adef03','2023-06-15 10:02:00',NULL);
INSERT INTO `users` VALUES (3,'jane.smith@company.com','$2b$12$KvdHS6r1OdmCGEGm1JR6mCiVAe2Aw5FE5pRnvT4tzWaOLGW/C7Lfq','admin','ak_c3d1acafaf8a2067','2023-09-07 10:18:00',NULL);
INSERT INTO `users` VALUES (4,'backup_admin@corp.net','$2b$12$EVGW69jsUTj8bPswi8egcsbiaKAj2n0QYnjcdfTR6hHA8k85xgr93','user','ak_2d377c71dec640ee','2023-02-24 10:19:00',NULL);
INSERT INTO `users` VALUES (5,'root@company.com','$2b$12$f6HQYsXjjyyq2wvz/.Zn80Ybkju.FpLwGCeO.k4BtEh6BMU6SVZ27','user','ak_0ebf17ed4bad58da','2023-06-11 10:09:00',NULL);

