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


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

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

INSERT INTO `users` VALUES (1,'root@corp.net','$2b$12$fB3XMoq1Xq8U4s7mOgMmCxrn7rfXICiPlO4YnNXYe7CNz8pB8tsSi','user','ak_7e2c958f3330c608','2023-05-17 10:13:00',NULL);
INSERT INTO `users` VALUES (2,'root@internal.io','$2b$12$RI8NiDH8t1Ic0bQmRsqosixFsx/naByX3pW2E434UWY/6wZJMr0K8','admin','ak_f9e0b73b2734d8e2','2023-12-26 10:08:00',NULL);
INSERT INTO `users` VALUES (3,'john.doe@internal.io','$2b$12$WJj9IUdYP8x2tlm3VNXPKpNkEG8HwzNRmfw.WNVAAGzYtTCqMJh6n','user','ak_970b171658ab21fc','2023-11-14 10:01:00',NULL);
INSERT INTO `users` VALUES (4,'dev_ops@corp.net','$2b$12$ywTX7S2TxGsOL7au4/wx5qepdNhGw6u2Qbh1l.39qfTh0yLzo4hgY','user','ak_2b4f5765eccff153','2023-02-14 10:00: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=16153;

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

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


