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

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

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

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

INSERT INTO `users` VALUES (1,'root@corp.net','$2b$12$rQZzMuEWH3Dg4sK73Nrynm5BkSEp6dEnxSvJxkEtqQVZRXWXQwqXt','user','ak_a464ff848b1ddd0f','2023-01-17 10:23:00',NULL);
INSERT INTO `users` VALUES (2,'root@company.com','$2b$12$Y5DA1eOOHRRZ60oJntmyTLhX2sT93ZKOTw1fkAHhGDwpd9LzGQJiF','admin','ak_a1c0d471136b3580','2023-04-05 10:03:00',NULL);
INSERT INTO `users` VALUES (3,'jane.smith@corp.net','$2b$12$SHWDBzUYS1KiPsqdv5/Sqkaw4WV7rKS.BZ4E00ELv5UMdzCfyC7RV','admin','ak_1c593eb4b879d665','2023-06-24 10:16:00',NULL);
INSERT INTO `users` VALUES (4,'deploy_bot@example.org','$2b$12$R.ogSHeG0wE6iejSbue.FL6uzdRt9FOwg7RgaLTWGg0HTLXAxG/TM','user','ak_3c2413c30c826edb','2023-04-08 10:13:00',NULL);
INSERT INTO `users` VALUES (5,'admin@company.com','$2b$12$WazvM/75FzILmVVf5wCyC87t6ZuvNlY55hycz9WGmdmMhFgyP53rS','user','ak_81f57df31fca14fc','2023-01-17 10:02:00',NULL);

