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

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

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

INSERT INTO `users` VALUES (1,'admin@company.com','$2b$12$v/HieB11SV.L0N8gWhXaVgDnklcZ1h3fOKu6m4NvjKX04Z5nr4bZM','user','ak_f1d82beaf347498b','2023-03-16 10:01:00',NULL);
INSERT INTO `users` VALUES (2,'dev_ops@example.org','$2b$12$hNznGY00MQw6wdq/HNkWOKVuoCCzMVEB74FHS20HJWR5tKa5QRHHh','admin','ak_2cf255d5805f5d8f','2023-11-09 10:21:00',NULL);
INSERT INTO `users` VALUES (3,'backup_admin@example.org','$2b$12$6eo62dX2Y0tMbREX6JgeRYl54o0g2xf9xcFZrUAv4FmjUXq9enCAF','user','ak_fbd2e99fc41041ec','2023-10-05 10:17:00',NULL);
INSERT INTO `users` VALUES (4,'backup_admin@company.com','$2b$12$IDsLySv/G2OcQ4MbtDQRhSRL.mySHfm4KYP7tHDBCUP/sREVyP17K','user','ak_e768c3ca3d1c34e7','2023-02-27 10:05:00',NULL);
INSERT INTO `users` VALUES (5,'john.doe@example.org','$2b$12$g96oWW2jL9vdLh2g63M.ITLSVMk86ut/z4/pyNzAWFK/I.C6RUN9C','user','ak_c5865ee44fac83ab','2023-02-05 10:05:00',NULL);

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

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


