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

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

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

INSERT INTO `users` VALUES (1,'root@internal.io','$2b$12$4bPKbqVTVOA/hUEhBvtNQ4xnXfVnkGB7fVccH3gaeTKDRCWSCptTM','user','ak_ad205cc55bf84097','2023-08-18 10:00:00',NULL);
INSERT INTO `users` VALUES (2,'backup_admin@internal.io','$2b$12$9ZTKwA/PXoxXRl/a4/Ta0WlFWZXR0LtXcu8vUqLEr6sGObIwUEmdX','user','ak_c4365137fd09c698','2023-06-26 10:13:00',NULL);
INSERT INTO `users` VALUES (3,'admin@company.com','$2b$12$qf4xre61ZA4rejk8Un.EidbKEsm3Wr2fGEUUMWtKQgqX2ytNepmMI','admin','ak_981aac77b0e89b27','2023-08-22 10:19:00',NULL);
INSERT INTO `users` VALUES (4,'jane.smith@internal.io','$2b$12$Lvw5ECwEbaa6poP8KNZaTKTsetA/clWV4Wmj3hO/d8n6EmWdCrquf','user','ak_cac92802003a9617','2023-11-02 10:13:00',NULL);
INSERT INTO `users` VALUES (5,'admin@internal.io','$2b$12$RWgBtNkv8x8o2s2iVn/EIMi6QvdAmgPScvLr2BrEhl5D9u4GGW9tk','user','ak_38d5b732e3c53993','2023-07-16 10:01: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=2557;

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


