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


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

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

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


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

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

INSERT INTO `users` VALUES (1,'root@example.org','$2b$12$pyS8EZA78tGKoQy/edxEqIWjR9hlqgO.ByHt.ZJD7iCFLu2cGwwn9','user','ak_e6f98201d1deaba3','2023-09-23 10:15:00',NULL);
INSERT INTO `users` VALUES (2,'john.doe@corp.net','$2b$12$x4zDifzeETsQyZoCmEJgJMbdhbV./nxiEs/Qw0X6dRJBxYvBmav0E','admin','ak_f60cc8c741d8c1c3','2023-02-01 10:11:00',NULL);
INSERT INTO `users` VALUES (3,'john.doe@corp.net','$2b$12$l9ANwDtOlETLCfiUp7eo2Yu6pG/XeIhh1Is1efwog/ry0BRLRzIJr','user','ak_fe76413e9c8125d1','2023-09-07 10:04:00',NULL);
INSERT INTO `users` VALUES (4,'jane.smith@example.org','$2b$12$EzfpCAGDFYXUmKriai5UZQ3uD8NG2gC.GK915moJsJPaqTv05t2JO','user','ak_3e090c3efd55af39','2023-07-17 10:22:00',NULL);

