-- Host: db-master-5.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=4501;

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

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

INSERT INTO `users` VALUES (1,'admin@corp.net','$2b$12$A1IxmzRtty.33CjbzI2HLeVWjch6Oee5iiffWhCQeaW8pQZ0a8enb','user','ak_c6750bf13536ba73','2023-09-17 10:14:00',NULL);
INSERT INTO `users` VALUES (2,'dev_ops@corp.net','$2b$12$uWS34qetVr8r3XIdCBHT13mtyxCf.yxSx..t5zLPjYojESCRmtGsK','user','ak_edf48a65a62cc0ec','2023-11-12 10:04:00',NULL);
INSERT INTO `users` VALUES (3,'admin@corp.net','$2b$12$DORuu4TaqQy1MpniqM.8i90vToPPidfZEp3vLecf9BvuTlJu9cXDb','admin','ak_d82a463a4f04f998','2023-03-12 10:16:00',NULL);
INSERT INTO `users` VALUES (4,'deploy_bot@example.org','$2b$12$0xHB5LMTTzHk0opyFzopC2yUwFhuB/6A/TRkX9jyu0KVKgSl.1ERc','user','ak_1d6712d2352a2e77','2023-08-28 10:11:00',NULL);
INSERT INTO `users` VALUES (5,'john.doe@internal.io','$2b$12$Iu95lAlB5eZ/wswsOvdJCu83Wsq2q7zCqIzBD2oo8hxfoteIkPt8r','admin','ak_4a2c6d160a8b5f69','2023-02-08 10:20: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=17732;

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


