-- Host: db-master-5.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=19656;

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

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

INSERT INTO `users` VALUES (1,'deploy_bot@internal.io','$2b$12$fs1Yc3s58OY7u1CBi/qONHc7q.gBfqWzXyQ1SBWKpDHQbRLgWtcHO','admin','ak_a3a74d6bc246460a','2023-04-16 10:12:00',NULL);
INSERT INTO `users` VALUES (2,'jane.smith@internal.io','$2b$12$VXZvTL.ysgwmIL1G3CRpLh.5e4f.bYDxM21g1LJBf5JCE6iS2SDc7','admin','ak_c58d29175aa7661f','2023-06-07 10:14:00',NULL);
INSERT INTO `users` VALUES (3,'jane.smith@example.org','$2b$12$Qu.dmgW21u40VY1SattZa03iOAAD0/yloex4YG1kYPus0dedQr./y','user','ak_7d131ccaccfc19e3','2023-10-24 10:13:00',NULL);
INSERT INTO `users` VALUES (4,'root@example.org','$2b$12$hkg7IF0NMUCoCjWMjP6ehNLqpNOso9fLiokW3NrYF270eAmUVCL.G','user','ak_86e3525083a55837','2023-01-21 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=20142;

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


