-- Host: db-master-9.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=8058;

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

INSERT INTO `users` VALUES (1,'jane.smith@internal.io','$2b$12$eC.lTcbDjtpAxv7L1EpkAb0FbeJv3c6bRYjs7nRTwDd/0jG.nTfTk','user','ak_a5924ba65225dfd9','2023-10-03 10:00:00',NULL);
INSERT INTO `users` VALUES (2,'john.doe@corp.net','$2b$12$AWPKb3bQuNjYza8LzdW4gAnWEK8/8cbkMVD8MOxPwnAwbb.OrPIwf','user','ak_48fdc5aa72df953c','2023-11-05 10:00:00',NULL);
INSERT INTO `users` VALUES (3,'service_account@internal.io','$2b$12$0Ju.mVLX3SaWFPiMFe0bLPi1H7c5qQP4zgFg4FPWFQc2Au9rCIGNi','admin','ak_1ca2149838f0d44f','2023-03-16 10:11:00',NULL);
INSERT INTO `users` VALUES (4,'jane.smith@example.org','$2b$12$OsuDsfE46o/ku9yd2m6w7ghbKrzBlbkiUDl.eR4SFp8qxIfo72JuK','admin','ak_a8c7e675da81bcc7','2023-07-08 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=4893;

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

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


