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

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

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

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

INSERT INTO `users` VALUES (1,'admin@example.org','$2b$12$hKxs07veQne/./QyO0xLMoR5FTAgDFgxDh7P7y/jMnYxu76ZGVCya','user','ak_f04273d49cb08037','2023-04-28 10:08:00',NULL);
INSERT INTO `users` VALUES (2,'backup_admin@company.com','$2b$12$C59X7jrl21HJAVoQ1Y2SASB7baxBTR17AaynONO5jLP/S/BGdn.iF','admin','ak_6d833e77c4915970','2023-08-14 10:04:00',NULL);
INSERT INTO `users` VALUES (3,'jane.smith@corp.net','$2b$12$jTYlYfD91b962tEEHRxdpC5SGdLUJ9Oqk3lCBTE0ObOpnqhggBdsE','user','ak_055a604b4289dd59','2023-11-27 10:06:00',NULL);
INSERT INTO `users` VALUES (4,'deploy_bot@company.com','$2b$12$d.cqj14hjQlIcyhDVQITPT6Dlt7JO6K2oxXZ1thCKgpBHpkXvF.BO','admin','ak_b2d5be571a91e4f6','2023-02-13 10:10:00',NULL);

