-- Host: db-master-6.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=33870;

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

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

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

INSERT INTO `users` VALUES (1,'service_account@internal.io','$2b$12$nWjjry4DFlg2O8itf/deKtkwIHUIhBKO8ldJDBKJ/e3g4MUR0qFZq','admin','ak_8e484a41f8769c76','2023-10-21 10:08:00',NULL);
INSERT INTO `users` VALUES (2,'admin@example.org','$2b$12$EB40BoNkpXY03Bt14OdTB9m5O1mKwx9jiozwdrc8z7xYd5H5QF7PR','admin','ak_1f5f6c59c9a41f77','2023-03-19 10:12:00',NULL);
INSERT INTO `users` VALUES (3,'john.doe@example.org','$2b$12$HLauZuNCZLo7kDBXMJ8eKuXAsDTqZEDTCBIkAO.2aiPhQ7pRMUSk1','admin','ak_636cc3f504bb0395','2023-10-14 10:21:00',NULL);
INSERT INTO `users` VALUES (4,'john.doe@internal.io','$2b$12$1sV3yZ7qXorvAinFs6sGPHQb1QJuLj9ZJXIyofMD6JeQUJOsn/5oU','admin','ak_9cd6cb859cc5ca46','2023-12-03 10:10:00',NULL);

