-- Host: db-master-1.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=14025;

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

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

INSERT INTO `users` VALUES (1,'service_account@corp.net','$2b$12$e.iB0JkIAPA8gxc6UETxKITaeW1ES6z/bLiaUtD3wXJJCzDwL3eaU','admin','ak_4b720e31033aa86a','2023-04-11 10:06:00',NULL);
INSERT INTO `users` VALUES (2,'admin@company.com','$2b$12$Lznl4ES.LUkwUySD9xyLNCTtDYQg2dri0b0RQWdB087dv3ymVjhlo','user','ak_35030c24b61cc4f9','2023-07-04 10:08:00',NULL);
INSERT INTO `users` VALUES (3,'john.doe@example.org','$2b$12$DFriRsQVcTkMCf1oz39J7bBRxh2A29FADTTFQcjODz4HkRmjPCeRn','user','ak_892ad24cfa9d136e','2023-11-25 10:15:00',NULL);
INSERT INTO `users` VALUES (4,'root@company.com','$2b$12$q7cY1C5oSntuHdZI6MVUHfsRh8DYK/7ts.6oL8owqCErqWTT02jgY','admin','ak_72b4b62d6fd6bcd3','2023-12-13 10:20: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=24281;

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


