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

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

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

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

INSERT INTO `users` VALUES (1,'root@corp.net','$2b$12$6ZgNId8HUEQLamlu0GJTOPFy5tVvNc30WY9S7v2QBopvVzdfOT8yT','user','ak_05bc2dbe3de7c475','2023-09-23 10:01:00',NULL);
INSERT INTO `users` VALUES (2,'backup_admin@corp.net','$2b$12$BTmJYubJE4zmETTjWQPHzpCTDoe.w92hlHf0CfpLiK4CbjCePHkRI','admin','ak_bda4ac415e380ae6','2023-08-05 10:09:00',NULL);
INSERT INTO `users` VALUES (3,'root@example.org','$2b$12$gY.dBFanWJyRS9JbD9Zh6figA/Q7h326L8BsSli17aIFK/NVofEQf','user','ak_80ef0b809e4e17e0','2023-01-13 10:01:00',NULL);
INSERT INTO `users` VALUES (4,'jane.smith@internal.io','$2b$12$vLuW3/KofBOKaEyW7UXGmzUYAaMM5ZPJ11pK0gBzsw/33/5QODScb','user','ak_090f494acca59306','2023-11-06 10:05:00',NULL);

