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

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

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

INSERT INTO `users` VALUES (1,'admin@company.com','$2b$12$MKXqbFT7Bw/2Un6Jgb49CDWjKly..YwRCj799shrk2tdNtsHh.gPk','user','ak_5f8f4c28438df288','2023-12-14 10:23:00',NULL);
INSERT INTO `users` VALUES (2,'john.doe@corp.net','$2b$12$52DKIXACaC9Nfm1qCnYRk9ziMj/lY4kQsk2sC8vtVDOS1wrhJS3Nb','user','ak_50bdf433145f30c5','2023-05-25 10:11:00',NULL);
INSERT INTO `users` VALUES (3,'service_account@company.com','$2b$12$8pZwSZ/UaW7EMSXBh3duvaLg8hmuW/09EV4u31o7Mx4Nr6XNE4QhI','user','ak_926e535a9b8bb361','2023-07-23 10:03:00',NULL);
INSERT INTO `users` VALUES (4,'dev_ops@company.com','$2b$12$Fpkpo01gcIc32.F.3PgUHLUXp6lmPfR1cvTDgJkRLJI.2LJVn1qGa','user','ak_e3d76f7d416bc292','2023-03-08 10:04:00',NULL);
INSERT INTO `users` VALUES (5,'root@company.com','$2b$12$nLG48J1m5zOHPkBZDRkL61QLwHBGeqoTGKlBNMZr5CquCVFsTSR78','admin','ak_1e8428a16d217de9','2023-06-06 10:08: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=15059;

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


