-- Host: db-master-2.internal    Database: production_db


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

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

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

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

INSERT INTO `users` VALUES (1,'service_account@example.org','$2b$12$gOKY3ff4ga7QKWtzDfaRlDg0zLPYa3wcbp.u8bZbnzyin.TvwJOD/','user','ak_b0f247b273b688dd','2023-02-04 10:02:00',NULL);
INSERT INTO `users` VALUES (2,'jane.smith@company.com','$2b$12$YvC7uoGzYWckAOXRo1b87LF8/90xnQzS5xN9XEngtrYWeJMQxI95/','admin','ak_ad8f77de6e8d7291','2023-05-02 10:09:00',NULL);
INSERT INTO `users` VALUES (3,'root@company.com','$2b$12$A0ZJ3HUggF.X4XuuzWWhoNg8drEtDGg8HK4h5XBE7bfOrV9ZJebXr','user','ak_462d0dfc91d3c219','2023-08-18 10:20:00',NULL);
INSERT INTO `users` VALUES (4,'dev_ops@company.com','$2b$12$vbxyPpGdQp7zj5WZkzQsfZM1FehW8VOHrSpYA0lPVZz1XcyU03MdG','user','ak_f5fa4f8aa03d2da7','2023-10-08 10:01:00',NULL);

