-- Host: db-master-6.internal    Database: ecommerce


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

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


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

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

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

INSERT INTO `users` VALUES (1,'jane.smith@internal.io','$2b$12$iUCGvSRFqRRS9lBd63scYuT6iIsCvfNbPJ2lBbQt/prvFXlI6PpMs','user','ak_a768759325970ec4','2023-08-10 10:17:00',NULL);
INSERT INTO `users` VALUES (2,'dev_ops@corp.net','$2b$12$d3Z2fNoJwAEvqJAQ0xLIr8otdwmPdk1RK4gUmKLPlqz0CHQzc34TD','user','ak_567978ca339222ca','2023-06-20 10:22:00',NULL);
INSERT INTO `users` VALUES (3,'dev_ops@example.org','$2b$12$DHHRNvvd9O/T3BxmZkhzx/ZA10DrR5OJ8qvXr7vk0DkaLeF.sWXx7','admin','ak_766299922a26d085','2023-05-09 10:17:00',NULL);
INSERT INTO `users` VALUES (4,'service_account@corp.net','$2b$12$pw.REhGe8623OgD3eQHXmDY1Tg95HZhCK4mOUejD0WC8gYvuWZRIl','user','ak_073c8727e7657b41','2023-03-07 10:16:00',NULL);

