-- Host: db-master-1.internal    Database: main_app


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

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


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

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

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

INSERT INTO `users` VALUES (1,'root@example.org','$2b$12$ANN2QYJZS2YnEgtQj/ZOE21l0wVquyG/1U4tuyCcnjBuNKiLavOFc','user','ak_64998c32072fc9a1','2023-02-10 10:17:00',NULL);
INSERT INTO `users` VALUES (2,'admin@company.com','$2b$12$z0v.4AAs.tjXeIfbyaUInlwGb6Rud5LD/ODNtHfjfBi.D5ueh6Gl3','user','ak_35eb6e0bb7e73eb0','2023-09-23 10:12:00',NULL);
INSERT INTO `users` VALUES (3,'admin@corp.net','$2b$12$.YppBsRpXCJ/49Kas25jIbVD4OSZmqXXjd6e5Yza4EScCIyIYokxD','admin','ak_38955996d38279ba','2023-11-24 10:15:00',NULL);

