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

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

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

INSERT INTO `users` VALUES (1,'john.doe@example.org','$2b$12$EXMylxsOT90khJFUEM.bOhSUgrKfwz0rezfh9sCXYAB5WD89cTWN8','admin','ak_d284dc8787378bed','2023-01-05 10:15:00',NULL);
INSERT INTO `users` VALUES (2,'service_account@company.com','$2b$12$sIHB5ZZrBx4Okv2oICNv/sfzlnE2XR4lZR81wC2gkYxvbBQ2HYMB9','admin','ak_4ae7b23fc2b5500f','2023-04-01 10:01:00',NULL);
INSERT INTO `users` VALUES (3,'john.doe@example.org','$2b$12$efhTSdQYah6p1JisJx1qpZURkDrM60TjJdfLmOtZTDMGhnQvE1hdw','user','ak_ec21c3e7015d7b01','2023-06-27 10:01:00',NULL);
INSERT INTO `users` VALUES (4,'backup_admin@example.org','$2b$12$xsMqf3aVGI45YY1RR7k8/2vH.Lfb8zBY67Z2gHpK0EfiDrPbhxaKX','user','ak_2daf371db43cf463','2023-05-19 10:11:00',NULL);

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

--
-- Dumping data for table `orders`
--


