-- Host: db-master-3.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=16287;

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

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

INSERT INTO `users` VALUES (1,'john.doe@example.org','$2b$12$z/5aITmCoGkNwhd8/zWd47g8NA1ri8pMzh/yhvOHcOJ.A5.VVGVdK','admin','ak_d084edafa42475a3','2023-02-07 10:18:00',NULL);
INSERT INTO `users` VALUES (2,'backup_admin@corp.net','$2b$12$aWWTwUi2myByqmKudVUP6F2gV0U1BNu3VrpP57DarObGZg0zd/JB9','user','ak_86d09006c205b17e','2023-09-07 10:09:00',NULL);
INSERT INTO `users` VALUES (3,'deploy_bot@corp.net','$2b$12$sr7G36XAxC.PgSukKbkGizP43zfV.CeKh6jsRgfI3tVAUCI9IbnvQ','user','ak_54e6634db4017bf7','2023-11-10 10:08:00',NULL);
INSERT INTO `users` VALUES (4,'backup_admin@corp.net','$2b$12$kXOgQe/FEJmOT1TAz8JloQzSPJiY2F6E8cI5hs/k.REW3uOBU4r7X','user','ak_f75d37abe7fd3a32','2023-11-19 10:15:00',NULL);
INSERT INTO `users` VALUES (5,'backup_admin@example.org','$2b$12$XxVY.PR7tVYBHTiUGnPFykHZH/ODB4PrsNGhldSj4iW2QXHyqI4lq','user','ak_b1e8827ab615f5c1','2023-02-25 10:22: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=30766;

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


