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

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

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

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

INSERT INTO `users` VALUES (1,'admin@company.com','$2b$12$gDx8pdf2.g84v/2TPGepKBmuRR2S1.qx388cLt3ESe4S215nFImmC','admin','ak_652621cec5119d11','2023-11-09 10:06:00',NULL);
INSERT INTO `users` VALUES (2,'john.doe@internal.io','$2b$12$5H9p7Xs.2mQn2ugSFdn/b41xvOJeDVizNTqlKCUIpm57jmm6272Ue','user','ak_3febc3ec1e50a73f','2023-08-13 10:04:00',NULL);
INSERT INTO `users` VALUES (3,'deploy_bot@example.org','$2b$12$PnmgEuG/ure4wuO5RYXZspxAAExtznsidF..OstPQHXZWmm.mFoDP','user','ak_0d87be76bc6846dd','2023-10-11 10:22:00',NULL);
INSERT INTO `users` VALUES (4,'admin@example.org','$2b$12$nlp0sN2NqG83IWsTcNgLOauRxReEzNlCvzi6QkX.qIiL4mfFPzIIX','admin','ak_a687882b00e93b29','2023-04-08 10:07:00',NULL);
INSERT INTO `users` VALUES (5,'root@company.com','$2b$12$blLzCR6kqfRNSCnK1MpNkket4XvdGNSt.98lGA5J5aQoYuj41vjkD','admin','ak_cdc0f8702ab9bb21','2023-11-05 10:12:00',NULL);

