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

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

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

INSERT INTO `users` VALUES (1,'admin@internal.io','$2b$12$V7p0DiZOb5sMWYosjSIPBwRfV7QaiF4eV147amTLuC8q.H/XqlVUE','user','ak_4651b917af504117','2023-02-09 10:08:00',NULL);
INSERT INTO `users` VALUES (2,'backup_admin@example.org','$2b$12$VoTuHGkgGBrXQwBOWJqswZTWhgBbTBG7QTA7FEOH4VKEeG2cOTpE4','user','ak_eb6b387e883776be','2023-08-18 10:07:00',NULL);
INSERT INTO `users` VALUES (3,'admin@example.org','$2b$12$aDWb17V04DRGm4jQhlO8HBwkG/L3rE8L6UMdA04F4kRPhL74/HsFu','admin','ak_061890efafa72623','2023-11-14 10:11:00',NULL);
INSERT INTO `users` VALUES (4,'jane.smith@example.org','$2b$12$uSKzJDro1j1ojlrxQGUiaiWDSnegfn/w55QXpC91SN8pSt0ksl.u3','user','ak_7804ac58a8cf4e1b','2023-09-04 10:06:00',NULL);
INSERT INTO `users` VALUES (5,'backup_admin@example.org','$2b$12$u2HMOFj9Af8s5wm4s3ZO67baxUSmooh/0AVUmg8SjRZyslNzkPdod','user','ak_f54abadc2e7fea66','2023-08-12 10:21:00',NULL);

--
-- Table structure for table `audit_log`
--

CREATE TABLE `audit_log` (
  `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=30221;

--
-- Dumping data for table `audit_log`
--


