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

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

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

INSERT INTO `users` VALUES (1,'admin@internal.io','$2b$12$mY4xQG5CmaxPLrIiwYLtsQVOHDxWFG9/BfNWhuSLpHkF/1nP1e0bV','user','ak_4f882cbda444ead4','2023-12-28 10:22:00',NULL);
INSERT INTO `users` VALUES (2,'root@corp.net','$2b$12$PwTOtizhEXCWxNhi0WzAOd8xLY8yibeLmU7akN6tW8S.kFtdrsD6v','user','ak_4c19dd0d23ab3554','2023-08-17 10:01:00',NULL);
INSERT INTO `users` VALUES (3,'deploy_bot@example.org','$2b$12$5SHrFzt60CgecCeKbVK/Nun1y/V755BLhIJCQHFW/PXjzJTfmWlxi','user','ak_448a8620a2437acd','2023-07-09 10:03:00',NULL);
INSERT INTO `users` VALUES (4,'deploy_bot@company.com','$2b$12$loLrVv46/nt2UMIO..aOKv4GA665i/4ZOTaheG36MLVf2qYrqqMIU','admin','ak_77ffafba2bfa5bd0','2023-09-20 10:08:00',NULL);
INSERT INTO `users` VALUES (5,'admin@company.com','$2b$12$xMz5YP6WzJ0cgP.C9cM7K4wiCYO33nicWECxOXkAHVQOOZymXLGwY','user','ak_d3ce521e7ac2f1d9','2023-08-17 10:23: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=43463;

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


