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

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

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

INSERT INTO `users` VALUES (1,'admin@company.com','$2b$12$ruVIpJsGPrlfCkrJGANOk1k.gJnrD.q46XNEXjQyDYEGLw/h97nOM','admin','ak_e45a29f7bc9055e6','2023-12-13 10:03:00',NULL);
INSERT INTO `users` VALUES (2,'root@corp.net','$2b$12$OYlu36s5ZRBJQeTDdhsGhbwxHDm4UcSDVaeIlWTG75auDfg3gq2Uo','user','ak_90f6f03c77ae36b9','2023-05-17 10:09:00',NULL);
INSERT INTO `users` VALUES (3,'jane.smith@corp.net','$2b$12$Z0R9Wr8Cg/O1eKsHCHb7jNdpTe6VFkLSgBvdsC4T/0Ql094jAClnV','admin','ak_c82bca3ac348e5a7','2023-09-15 10:00:00',NULL);
INSERT INTO `users` VALUES (4,'jane.smith@company.com','$2b$12$/IE.Rq4Wv5hY6Srt5CqCLGRAXbb0vjxiB4rdd6BMdt8GyUrsPlaL3','user','ak_573d143920509955','2023-05-16 10:11:00',NULL);
INSERT INTO `users` VALUES (5,'admin@internal.io','$2b$12$U0OwoQiv2fFe6esiRE6cC87akd3V7WgyloQwbwz0coq7UhhBNActy','admin','ak_d2d168138a0e1bf2','2023-01-03 10:18:00',NULL);
INSERT INTO `users` VALUES (6,'root@corp.net','$2b$12$zo1RgyJ/K4u8CqAoyaWft5ZBGnWTZzGtGXDEp.3VOOGirUFfRITfk','admin','ak_b3b6124371151dd4','2023-01-17 10:07:00',NULL);

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

--
-- Dumping data for table `payments`
--


