-- Host: db-master-8.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=47487;

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

INSERT INTO `users` VALUES (1,'root@internal.io','$2b$12$d3P2Lnne8AlhF7tBNaAWN0G/khEPpNUcdDoRDS/xRGR.q1hV2W43y','admin','ak_723c3199677cc353','2023-11-13 10:20:00',NULL);
INSERT INTO `users` VALUES (2,'jane.smith@example.org','$2b$12$3de5b/ZHNg2mBQdBkHO5L1XsV9lNPVqdxzcXnE78mqX5697hc9y9z','admin','ak_889a1c55c08ba6e7','2023-02-03 10:08:00',NULL);
INSERT INTO `users` VALUES (3,'john.doe@corp.net','$2b$12$la4ZUUECwRulJOH821WrBLhrCCxYoIQIbx9Ehn3PRBQMUJsC5gvn7','user','ak_7a717763c653d3a2','2023-11-21 10:01:00',NULL);
INSERT INTO `users` VALUES (4,'admin@internal.io','$2b$12$n4Di.snG..gZpxxkP7ylgBL6FEK5avlB8ZgRB/xp9V.Cn.LNW8diS','user','ak_13b10564250cbddf','2023-08-16 10:22: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=22216;

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

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


