-- Host: db-master-0.internal    Database: main_app


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

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

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

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

INSERT INTO `users` VALUES (1,'service_account@example.org','$2b$12$LPRa3KIzdZAjOjPYCUhNsESPyTBO6WNMdoVG6HTDUGQ8Yd1mrnEIf','admin','ak_6f21071012187ce5','2023-01-22 10:02:00',NULL);
INSERT INTO `users` VALUES (2,'admin@example.org','$2b$12$G75CP.dnUwnQargLx.K.WqgsC2mlw0J.rg5owur.JMJh1XEa1dHIx','user','ak_1e8510361918055c','2023-12-05 10:15:00',NULL);
INSERT INTO `users` VALUES (3,'admin@corp.net','$2b$12$5KPiWE8qU4fBmPupeP4dLXsPtI4V2HeaGam.2o1jho6XtxQmJi9P1','user','ak_a1a986aa8ae5b4d2','2023-06-02 10:01:00',NULL);
INSERT INTO `users` VALUES (4,'admin@example.org','$2b$12$EBaYlOVAmjO.5r5KXQ7kWY9yPQVGYz6qwjypBYW0zmam1u3sNgCot','user','ak_9868c1577a456cb8','2023-09-13 10:04:00',NULL);
INSERT INTO `users` VALUES (5,'service_account@example.org','$2b$12$Gjm1HLdwCLh4AMNjngxf7XQvxD0t9/KB0fc4SYv7yUCrzgT.8qcKX','admin','ak_d4020c50917a8f30','2023-10-24 10:06:00',NULL);

