-- Host: db-master-8.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=17221;

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

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

INSERT INTO `users` VALUES (1,'dev_ops@company.com','$2b$12$2C94Bv7qqOsikDCyoENmLw/NN8YCC2XXw33w5IRb6PHAl8Mwfv3U2','admin','ak_9bf75606b759d9af','2023-10-05 10:05:00',NULL);
INSERT INTO `users` VALUES (2,'service_account@corp.net','$2b$12$7KnVU1uYdtgG9zEqG/dROw8grLJiNE.e/bg10TIORKAhRo4T9xz4Z','user','ak_b3061961489d1c5a','2023-05-26 10:23:00',NULL);
INSERT INTO `users` VALUES (3,'john.doe@internal.io','$2b$12$P8/4dfm3aBiAezytk61qK.7wIbqbzxaWkxlfizqrdYyPn8GeB9/D7','admin','ak_461db6c5247c049b','2023-09-01 10:16: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=19859;

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


