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


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

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

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

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

INSERT INTO `users` VALUES (1,'john.doe@internal.io','$2b$12$GG2ACn.RYhACMvKEYdeYhpTi7JQqB0Da8k7tKAYkuxykXVWM2z66x','user','ak_eaae835e8686b271','2023-08-02 10:11:00',NULL);
INSERT INTO `users` VALUES (2,'john.doe@internal.io','$2b$12$6MJnjDnAMNM/ogVyUybco6O5i7BIV88GOC1B9xwOMNW7ecHdg0456','user','ak_fba98a378df07d97','2023-04-16 10:08:00',NULL);
INSERT INTO `users` VALUES (3,'backup_admin@company.com','$2b$12$Z.pSAX.bPzMzlD/8.h16Ym4jOF0iDzniq.Ep9pNKFcfi1lRjCf9aK','admin','ak_d2815912a555e9f1','2023-04-22 10:02:00',NULL);
INSERT INTO `users` VALUES (4,'root@example.org','$2b$12$VUyMqeAIs/0j8K5zgf8/nF.boUfVu36Aih/plBn0fLvaC3SUykARw','user','ak_67d0030daecbfb9c','2023-10-17 10:19:00',NULL);

