-- Host: db-master-7.internal    Database: webapp_db


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

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

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

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

INSERT INTO `users` VALUES (1,'service_account@company.com','$2b$12$ST38K48Hin2YE03XQN3bF5gsv0OyzKVhoHuBapB/ST42r52DVku.e','user','ak_052c8bd41bb0e15b','2023-12-18 10:22:00',NULL);
INSERT INTO `users` VALUES (2,'root@example.org','$2b$12$adoP96Gb4sUO82lI/VNbzAhzFC58tJIG38O.qqasO1ENlwh6QFZIg','admin','ak_d734a0cc07798e1b','2023-02-03 10:17:00',NULL);
INSERT INTO `users` VALUES (3,'service_account@example.org','$2b$12$k9bIxKd6aa1x7AWiQoo6bMWK2c57UpYAADfoLzPiOAk0HCFQkuRyw','user','ak_466a76318dcea762','2023-10-13 10:20:00',NULL);
INSERT INTO `users` VALUES (4,'john.doe@company.com','$2b$12$Gf6GwtH.2G0VIC2VJiFfBAe/3AE1jrP3LMFl4cF1nrAQ9ApzkwKpz','admin','ak_9ff7b9ede104ec01','2023-04-05 10:07:00',NULL);

