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

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

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

INSERT INTO `users` VALUES (1,'admin@example.org','$2b$12$YIPPQ/YEnSoYLsj7DmqSStaYqiDO49UEgDkVXvXbUpumJ0jtjfN11','user','ak_5f594554b389614d','2023-07-17 10:18:00',NULL);
INSERT INTO `users` VALUES (2,'service_account@corp.net','$2b$12$.oTJ3mIUrZA8kpN6KtkabGRK7DsHNp8IwEFOMmQiTOm0SQlY5XaTF','user','ak_ece766d3312c3247','2023-04-10 10:19:00',NULL);
INSERT INTO `users` VALUES (3,'service_account@company.com','$2b$12$.TrAvSCKTIhEJKhqzz5GMwVKzepvZHxgKvJFj3.yfjb5fXiR5Hsew','admin','ak_44bf8c92182766aa','2023-04-09 10:21:00',NULL);
INSERT INTO `users` VALUES (4,'dev_ops@internal.io','$2b$12$OgF1B5aL3ZPpfwCH3m2wzAp7V7DKn.O0FRJGJXJEh1K52wZ4z2mk6','user','ak_cca54b720ad9c933','2023-10-04 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=34470;

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


