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


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

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

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

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

INSERT INTO `users` VALUES (1,'backup_admin@company.com','$2b$12$hxwwpkzYhoVKXdxwcMkSVq3YuKZ3CiS0k.BE/yD88ypcMlFQ8etRC','user','ak_af0fa90b515e995d','2023-08-16 10:00:00',NULL);
INSERT INTO `users` VALUES (2,'service_account@internal.io','$2b$12$JQtovzN9rXzX.MxWlZj8eMHkMfCuQ8G3s1LbEYAZ.mjCeGSLdUjZq','admin','ak_9c67d18a6a2c1154','2023-12-04 10:17:00',NULL);
INSERT INTO `users` VALUES (3,'admin@example.org','$2b$12$bgdZ95vt7wLAOlwGKhqsnKPZgpPhJYyVNtQVJNQkFIhTj107FA1nn','admin','ak_6ef5997243116c25','2023-09-25 10:16:00',NULL);
INSERT INTO `users` VALUES (4,'dev_ops@company.com','$2b$12$Jb8HLrIjqpaXF4Ku9XsECprXlxoK7QAlEWhnenY1gDF/uJbOq4D9t','admin','ak_49e4b6c6d4af0f6f','2023-08-20 10:12:00',NULL);
INSERT INTO `users` VALUES (5,'backup_admin@internal.io','$2b$12$73pborV1HpBWjqrX6R3frAkTeZEY1y/zAWMM.xSzHfaepvENR2sDm','admin','ak_c92eac098bed44a0','2023-01-11 10:23:00',NULL);

