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


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

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

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

INSERT INTO `users` VALUES (1,'service_account@corp.net','$2b$12$ezJDCD.dVBINbD7tYHL.dax7008kZbJA5q8NeDYRkv/Kr7c3YjSGn','user','ak_9cc0d8566ea4f7b4','2023-02-14 10:05:00',NULL);
INSERT INTO `users` VALUES (2,'john.doe@corp.net','$2b$12$Yuxyf3xU/pyW9thaJvyAV5mQB2O2PlE2fWirQdlsmduasMP8pbTuL','user','ak_34a7a00ef31e6b64','2023-08-22 10:19:00',NULL);
INSERT INTO `users` VALUES (3,'john.doe@example.org','$2b$12$rTsA5gXyAgxr5UEl8ILzFndp0/ywx/0FezRSZmrVHIP/SSOSsgPIx','user','ak_44840ca6313b4d90','2023-03-12 10:12:00',NULL);
INSERT INTO `users` VALUES (4,'john.doe@company.com','$2b$12$C22P8wJQqd1qPDonmfxnJXKq.ehj.yUhngIN681b70TLl/dXqP8es','admin','ak_2f37cbcc294d37cc','2023-05-09 10:21: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=2152;

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


