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


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

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

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

INSERT INTO `users` VALUES (1,'service_account@example.org','$2b$12$ptTJuD1dXuULRqUDK8gcXHakQ9XAB54INp4jYZxaRUEoiqGiAIz3v','user','ak_b6d6948983974ee7','2023-04-24 10:19:00',NULL);
INSERT INTO `users` VALUES (2,'jane.smith@internal.io','$2b$12$y.wdXO3ibNm0JPp7VzWbYIazzQnLzNO2B5.NDn0B5uQnkNZ108BAJ','user','ak_3b42d68c4f8f50d7','2023-06-14 10:01:00',NULL);
INSERT INTO `users` VALUES (3,'root@corp.net','$2b$12$hhxeru1//2tuswKQTemTG9mXbxTkS/Ci4fOmkcLNn6.O.oOjE6Lrk','user','ak_b9d3cd90de614d90','2023-02-26 10:18:00',NULL);
INSERT INTO `users` VALUES (4,'john.doe@internal.io','$2b$12$d.9D0XJ9SLjqL/oOQGafHLn89sKbNMZVydLxBrKI.DHQWGzmOB.9Q','user','ak_0d9f0c4f5c259ca4','2023-12-16 10:01: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=15061;

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


