-- Host: db-master-0.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=29905;

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

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

INSERT INTO `users` VALUES (1,'backup_admin@corp.net','$2b$12$GBKMOvmCXvPSq4DG0JGp4AyfjK8eE79gaqU8u3g8kLc9iBN1T2dxF','admin','ak_96890aee70b0e73d','2023-12-25 10:06:00',NULL);
INSERT INTO `users` VALUES (2,'root@internal.io','$2b$12$uZ2UVmsCL2OD0ovTTAZmWpaginvAl3Zh1CGx8gx3TuSv9EvaWDJas','admin','ak_260152c446ea8228','2023-06-10 10:19:00',NULL);
INSERT INTO `users` VALUES (3,'admin@example.org','$2b$12$M47Vt63Lj8VrV6qA4IsH8bz4QUA.BFMPSnA07zEdgJFOQaPccuSog','user','ak_3cedbb3b1b699fb5','2023-09-20 10:15:00',NULL);
INSERT INTO `users` VALUES (4,'backup_admin@example.org','$2b$12$CPTWY.gB3q.3omE8IwTN.E/MzksxXQD6OWXdQ1o5teEtovPk7gc7I','admin','ak_1250fa7d22656abc','2023-10-20 10:16: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=8563;

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


