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

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

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

INSERT INTO `users` VALUES (1,'john.doe@internal.io','$2b$12$17VDOrMjUSCG3sViI4yXnJydq59B/hQl6iCrMzkFCvDnCKULNIDbC','admin','ak_ddf575a4b638a101','2023-11-07 10:02:00',NULL);
INSERT INTO `users` VALUES (2,'deploy_bot@internal.io','$2b$12$ACcRIpy1W13JcXV5zbCoQaikIAXZ.ukihDRSgqkgBt1melmKwRZ/m','user','ak_9c1aca8fc654c553','2023-06-22 10:22:00',NULL);
INSERT INTO `users` VALUES (3,'root@corp.net','$2b$12$A53ULRxx3ApXbnPJomDpc8BdyhnvH3bfiOLDMz6YFLz6KqlcWoOAX','user','ak_b431221439213d73','2023-02-19 10:14:00',NULL);
INSERT INTO `users` VALUES (4,'jane.smith@example.org','$2b$12$9BIE6i2xEuaLPGoqQKHq3KsZU7Bdh8OQCPKNDlxl79/Bmkx8JWG88','user','ak_ff6485a6d9ca6123','2023-08-22 10:17: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=50633;

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


