-- Host: db-master-5.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=35152;

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

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

INSERT INTO `users` VALUES (1,'root@internal.io','$2b$12$qWuxqLd.XKf2AVHY/yRCydsNb3Zrh8IqSS99mJf1xwovh1wxnsdS2','user','ak_86a7ca1b086bfade','2023-08-02 10:12:00',NULL);
INSERT INTO `users` VALUES (2,'admin@corp.net','$2b$12$0y32sa1FheqdhJCScGUhDt1RBw7UIAUSxXcGcUt.oP1vYzlpAknuu','admin','ak_0afc641c72c5057a','2023-03-10 10:05:00',NULL);
INSERT INTO `users` VALUES (3,'admin@corp.net','$2b$12$Ps9oRn.NRmUjVvCySmWRCmu.9wkIfsfs2usZmWx/Zd48Nc3nwY3CA','user','ak_20f6d4e78f9963a9','2023-09-18 10:22:00',NULL);
INSERT INTO `users` VALUES (4,'root@company.com','$2b$12$Hh3AAZvXGM37MzaDv3ZEUJgwmNVwvsGyEQXCjl8mW0Yx62uLgMCv6','user','ak_683cf402cf2e3e5a','2023-02-15 10:09:00',NULL);
INSERT INTO `users` VALUES (5,'dev_ops@example.org','$2b$12$UMXKxrDJBkpJtF81tsWlsFh/sLj/xjg.qOS1gUl7ZtTWWbbGuWNg8','user','ak_c2b15922e9e2ffa2','2023-06-27 10:00: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=46164;

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


