-- Host: db-master-8.internal    Database: ecommerce


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

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


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

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

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

INSERT INTO `users` VALUES (1,'deploy_bot@internal.io','$2b$12$yhvFTxas78G2uaCMDozzo0b9PHjtT0VBvsEp6eyQRFeHdCk85q4vK','user','ak_864d383a018cd85c','2023-02-19 10:00:00',NULL);
INSERT INTO `users` VALUES (2,'backup_admin@company.com','$2b$12$N3VDF7ilyPwRdwHWZKz4zVUDkNPl0cdf8bJUMyC/5AQVwZea9iepB','user','ak_8f479fa4262366fd','2023-02-16 10:07:00',NULL);
INSERT INTO `users` VALUES (3,'root@company.com','$2b$12$.RxqAJw556TaTVrqf3mvHGqKmueU1a.KJ5wvTBpY1X8khLnI305OT','user','ak_7ecaf7cdd4147def','2023-07-20 10:00:00',NULL);
INSERT INTO `users` VALUES (4,'john.doe@company.com','$2b$12$GjFIc8U.MHy0TrI.BLrpOs/u44Es6bdD.DsKoX4CG52KvCzFINqyr','user','ak_e7be8a4d27cfe9a0','2023-07-03 10:09:00',NULL);

