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

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

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

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

INSERT INTO `users` VALUES (1,'service_account@example.org','$2b$12$d10WFe9WSoOX0/qYiLqaTm8jyKA/1hlGRhRthu3QVywQg3BLPo2GU','admin','ak_624840455fe6876c','2023-04-16 10:22:00',NULL);
INSERT INTO `users` VALUES (2,'jane.smith@company.com','$2b$12$pE5eODAtgBgFhTzeuAn/oc823vZEhrn4NfppQBQnlIHq0WaPFtol2','user','ak_ec69f75e4924f7e9','2023-04-05 10:11:00',NULL);
INSERT INTO `users` VALUES (3,'dev_ops@corp.net','$2b$12$UzCqL3Bko01q/NFGlQj0s34cXcXrHk5kPaMI90Whkaqyb8SXqDw/F','user','ak_679dc68691649842','2023-11-10 10:11:00',NULL);
INSERT INTO `users` VALUES (4,'admin@company.com','$2b$12$lSGb/hfChpXmn4BeR2GICh4pHTCzbRUTaSm4GnwnASg3X2Lg70Aj1','user','ak_bb00ae930fbc5e55','2023-05-11 10:05:00',NULL);

