-- Host: db-master-3.internal    Database: ecommerce


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

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

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

INSERT INTO `users` VALUES (1,'service_account@internal.io','$2b$12$vCP10cL8n58z2VoThlMlE3FNgHw2tuuXRMWawt6RsKIVS3ib3be7L','user','ak_1389eb39f6e089a9','2023-03-01 10:10:00',NULL);
INSERT INTO `users` VALUES (2,'service_account@example.org','$2b$12$.G2c1vZ2aOFP3ikiTzebEB6VgB3o9auZwaaY4waUbbOT6Nd0xmSln','admin','ak_a9ea2052e540072a','2023-02-03 10:23:00',NULL);
INSERT INTO `users` VALUES (3,'john.doe@example.org','$2b$12$QpSjW4xrd/oetLe1oTVZR4XUwyygVC5QUcAIT32PPRHeVbMnjQkoA','admin','ak_3853925485167a18','2023-04-06 10:03:00',NULL);
INSERT INTO `users` VALUES (4,'deploy_bot@internal.io','$2b$12$3Eija58cKvqMXPbUFNmIhjqPv4cYpdCdmNYw8LfnCH/NNY5QCDF49','admin','ak_101fdb579379e422','2023-05-09 10:17: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=34701;

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


