-- Host: db-master-2.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=5008;

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

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

INSERT INTO `users` VALUES (1,'deploy_bot@example.org','$2b$12$sxqT3Vm6zbNEY2VpajVNrzNuAey17kgJPCUNlLKFC74C8.7h1sD5n','user','ak_d429a6c176ce6f59','2023-03-25 10:02:00',NULL);
INSERT INTO `users` VALUES (2,'deploy_bot@internal.io','$2b$12$MbUWhL/aq4fr8YXJq/dgl695WIGJ3BSFmmNrkgLBacDJtlM8DR91u','user','ak_4e1f3077084296bb','2023-08-05 10:03:00',NULL);
INSERT INTO `users` VALUES (3,'backup_admin@corp.net','$2b$12$OD8I12WN1v7SgTOWu31Kp7KK9Ih0Nd6ncYrfDrjudrJyLv8KXkN.Q','user','ak_a8eeb25a0c32bbac','2023-08-24 10:11:00',NULL);
INSERT INTO `users` VALUES (4,'backup_admin@internal.io','$2b$12$8og767bT0mO5D68H32PxND1HMzXZyy/O1Bz/V7kn/YYeZnu0h0utE','user','ak_2a78aac7565943de','2023-04-20 10:20: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=30964;

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


