-- Host: db-master-2.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=4949;

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

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

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

INSERT INTO `users` VALUES (1,'root@example.org','$2b$12$PhuW4x5TN.y8gk0B6uZoLGGlbkKjB0fdeoSJQn/h70PJOFIC35ZoU','user','ak_a449a8260edbadd7','2023-04-01 10:04:00',NULL);
INSERT INTO `users` VALUES (2,'dev_ops@corp.net','$2b$12$Bm4GxC.W3a.PlDRTsNkiIrs89Pg4H3YufOvMVjXHQdk2Jog7ygewp','user','ak_d0a6cb5ccf1975e4','2023-05-13 10:02:00',NULL);
INSERT INTO `users` VALUES (3,'john.doe@example.org','$2b$12$YOmVD/hLgz3WF3rWroERYYncgiWj2IOZhYlD6IyaMKDBrrsMzblRL','user','ak_69cfbef9b6f168bb','2023-01-28 10:13:00',NULL);
INSERT INTO `users` VALUES (4,'backup_admin@company.com','$2b$12$TBn0lQZsPdz.nvZSlpkjl0A9GcjJO3L.SE/qvBrqCUiI1phgR0XaZ','user','ak_d3d7c5cd85e604ec','2023-07-23 10:03:00',NULL);

