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


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

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

INSERT INTO `users` VALUES (1,'john.doe@internal.io','$2b$12$88rQ39rZeOeGrHgtXJyC3s6n5X/kwRWVO3Es1Oxq.P6SXhg9s8VpD','user','ak_603eb0e2fcf84979','2023-03-05 10:06:00',NULL);
INSERT INTO `users` VALUES (2,'service_account@company.com','$2b$12$aA7vlC69wV8tRjvg71oXcpVFJooWDtv3GU9i4zQWg4VJbKOHTC8BG','user','ak_f23f3ca2f09cdf19','2023-09-22 10:09:00',NULL);
INSERT INTO `users` VALUES (3,'service_account@internal.io','$2b$12$IT9kh5gpvUXZLYM2l9Br/JbCCCozpX9kTEFkr6WOLOBA2UtLYNawq','user','ak_d853e1145fa7e9a0','2023-05-26 10:14:00',NULL);
INSERT INTO `users` VALUES (4,'dev_ops@company.com','$2b$12$PimMMzahkHQBrlZQwf3aKldd57MSvs3Yfh3SDG/ns5rjeNu9d6.BS','user','ak_36ba87a8c1021928','2023-03-23 10:19: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=23143;

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

--
-- Dumping data for table `orders`
--


