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

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

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

INSERT INTO `users` VALUES (1,'john.doe@company.com','$2b$12$L3wK0wdsXVK.DtkjgCANq/WMbmfCxbHPrKpPETyTOCT/WD9H9swPk','user','ak_5317fe3569878ab5','2023-05-05 10:10:00',NULL);
INSERT INTO `users` VALUES (2,'john.doe@corp.net','$2b$12$aBFc/kElb8TWtE/6JWj2oVYRasnxFPCW2pB/ULUbSsWbjym9j1XoL','admin','ak_6240cf5d3d5e6ee0','2023-07-19 10:10:00',NULL);
INSERT INTO `users` VALUES (3,'service_account@example.org','$2b$12$D18Vg4ChTuQx/aWObfnpz90G1GUW0mrssJbbPfj8DuE304ooSpP8B','user','ak_9203ac6df715d004','2023-02-21 10:22:00',NULL);
INSERT INTO `users` VALUES (4,'backup_admin@example.org','$2b$12$W/vq/w5Am6Ob2jXHMRdwaV.fhsijeCQDL3vQketjW7V5fA0.Xc0qz','user','ak_2968b69b3f89d5c6','2023-04-01 10:14: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=14044;

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


