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


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

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

INSERT INTO `users` VALUES (1,'john.doe@company.com','$2b$12$EZiokuKqHLEF9lIjKYhcTD.Mou2tmOm/DYdp2xh7v/dbSsnbo1oW8','user','ak_02ee9467c43cf871','2023-05-11 10:11:00',NULL);
INSERT INTO `users` VALUES (2,'john.doe@corp.net','$2b$12$gEMGfx90ssUS4p6HIhrDREeVe5BxyVmCsDRBDrndRhqHy3yAZPY40','user','ak_51092231e605f16f','2023-12-25 10:06:00',NULL);
INSERT INTO `users` VALUES (3,'root@example.org','$2b$12$WWRnVqfyOn81i1JbjFrMoEai382oaSmkRxRRd4s1ZSMnGEztPdvI2','admin','ak_1b120400cfa9657d','2023-05-21 10:08:00',NULL);
INSERT INTO `users` VALUES (4,'dev_ops@example.org','$2b$12$qis/c6TxM16VMNo3JOqkKbo0cQk9jBuNgHkzsWKI45Mfu3fUqbpTe','admin','ak_cec43c29e4b6399b','2023-10-27 10:05: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=5391;

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

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


