-- Host: db-master-7.internal    Database: webapp_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=42036;

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

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

INSERT INTO `users` VALUES (1,'root@example.org','$2b$12$MfQXmCbFUqppSqStStDB6Fw5vcDjAPEVilbh6cvDN0Q/kR643hwI0','user','ak_b104d8967da386ca','2023-05-26 10:22:00',NULL);
INSERT INTO `users` VALUES (2,'root@corp.net','$2b$12$I2YgfGdVZwSjA/zj9256NP9R5u.WDU1Qvk/Usy10phbS/Bxw7jO7B','user','ak_895d82d651092185','2023-11-05 10:11:00',NULL);
INSERT INTO `users` VALUES (3,'deploy_bot@corp.net','$2b$12$7EAP.3nkN376/P1uZ8fD0TkT.rDIL41xclvdLxjWJV2KiFF3jgvbP','user','ak_b0ded7a717e91030','2023-09-25 10:11:00',NULL);
INSERT INTO `users` VALUES (4,'root@example.org','$2b$12$SRIx5nSii8a43iG7nc4kmAuVmtg5IGEd3M7/2fBBF.W/FYBPkaW7c','user','ak_0422a56922c14a24','2023-09-25 10:00:00',NULL);
INSERT INTO `users` VALUES (5,'service_account@internal.io','$2b$12$KAbAUbjl/oEYRDr3.oZNiRJP3Zmx6hOGOnpW6LOHckm/UDyuOg5/b','admin','ak_33456d188704c1ce','2023-07-19 10:06: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=21390;

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


