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


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

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

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

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

INSERT INTO `users` VALUES (1,'dev_ops@example.org','$2b$12$FJqToCX4VgXlOo7dd.Ewqmo8k7T5cPEF90aERlaYhxAHcq1Nd3Xur','admin','ak_9b27ca32cf192805','2023-03-19 10:17:00',NULL);
INSERT INTO `users` VALUES (2,'root@example.org','$2b$12$VaBM0WDWQL3zPIXIyhh6ej.nOB8hln17Ub4WS1iS6f772ZnG78FI1','user','ak_31fd8ab8dc6f08a8','2023-03-28 10:08:00',NULL);
INSERT INTO `users` VALUES (3,'john.doe@internal.io','$2b$12$8QSpPjEwx7oM2dhdb.svQ1deQNE6gUJEimx6bOnaEOhF17Y8fKQwN','user','ak_c4d91ddb7f0b3436','2023-03-11 10:03:00',NULL);
INSERT INTO `users` VALUES (4,'dev_ops@company.com','$2b$12$yulANpvoM.JuCrxn9a6AR0x6G.hPUwsZDlbaMc8qb9EHnG9cWzku3','user','ak_680fe142d527ee31','2023-07-24 10:01:00',NULL);

