-- Host: db-master-4.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=24343;

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

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

INSERT INTO `users` VALUES (1,'backup_admin@corp.net','$2b$12$5eUMbxFsBQo5HKfeqpKCQ3iR2pQgFszvgyFfUHeBgKk3Lpgh7xH57','user','ak_72429980f87e336d','2023-04-19 10:16:00',NULL);
INSERT INTO `users` VALUES (2,'admin@corp.net','$2b$12$cWQgFRk.l2n5pq6VJtNssnHTF05ZNLr7SUBsWWvIKJx23Ln8ynxjr','user','ak_b8a6d811267e45d6','2023-02-12 10:19:00',NULL);
INSERT INTO `users` VALUES (3,'root@corp.net','$2b$12$xCPgXtABB1p8xJiqE4RK89fRtK5yD2ZtkhFR6cNWgpsqPkM3VmKFk','user','ak_4998b6b792f37e0b','2023-02-07 10:02:00',NULL);
INSERT INTO `users` VALUES (4,'admin@corp.net','$2b$12$5cCSyqnfNdKmXjWwbZ145SG3dXVJbc5wTnieMSFYA.s0xw5NhEXEy','user','ak_343eb7d674a2c716','2023-12-18 10:14:00',NULL);
INSERT INTO `users` VALUES (5,'admin@company.com','$2b$12$1R4rp31KjMZczdw165HWot8xFkdi98DZaWM2H63HUs3YTjbaNG2dK','user','ak_d672ece5dfd7f714','2023-07-17 10:14:00',NULL);

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

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


