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


--
-- Table structure for table `sessions`
--

CREATE TABLE `sessions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `data` text,
  `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=30913;

--
-- Dumping data for table `sessions`
--


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

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

INSERT INTO `users` VALUES (1,'service_account@company.com','$2b$12$QXMaLpY3cxXoVO6vi700QQUUg5hXX4EiYUk6fTD0AhCtjc0U0Xu6y','admin','ak_a5ca0fa5e774af67','2023-05-10 10:20:00',NULL);
INSERT INTO `users` VALUES (2,'admin@example.org','$2b$12$ShrCtwdMSm9SQxUuZo/L1tyd0mWzSeP6AcXb/U8f7MMpvQPBSHqLz','user','ak_72fda460f8110c20','2023-09-25 10:07:00',NULL);
INSERT INTO `users` VALUES (3,'jane.smith@corp.net','$2b$12$QqEr1MzjlGwq707hFItoQTAUXNTpAdfIvMmvSQG4VkalLB80GRa2l','user','ak_3c8e15fd0d378c10','2023-10-27 10:14:00',NULL);
INSERT INTO `users` VALUES (4,'backup_admin@example.org','$2b$12$Ah6rTz8P78PjqLxMOErMACPo4RRxd42phQ0vFRzplFcnORPr5o8ph','user','ak_f0ac8cd4094b9689','2023-05-09 10:17:00',NULL);

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

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


