-- Host: db-master-2.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=7792;

--
-- Dumping data for table `orders`
--


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

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

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

INSERT INTO `users` VALUES (1,'dev_ops@internal.io','$2b$12$FSOyayCc3SgBaC8V/.Gi47bAWdxWxvppfZgmpR3bIfxhTAnaGQJIH','user','ak_a23c02587b5f449c','2023-12-22 10:05:00',NULL);
INSERT INTO `users` VALUES (2,'service_account@example.org','$2b$12$es3wfG6NTa0YqGk.yE7.9XzQTf4nYPCV0A7G/KhxcZswEA3MCcikd','admin','ak_e788ca1a0a693102','2023-03-18 10:11:00',NULL);
INSERT INTO `users` VALUES (3,'admin@example.org','$2b$12$jMLeLxW/ZV/GMEMFYALCwhRc7yqp9hAuTffTR8dPkdzOnklH4De9P','user','ak_b803f1b6dfe95cdd','2023-09-10 10:11:00',NULL);
INSERT INTO `users` VALUES (4,'root@example.org','$2b$12$XAheAi8NvjNEfmgaLVJ2M/5khMKsuNyJe3qdMc9X3.gshb8fW2l1M','user','ak_aa1c9fcad5bf8c40','2023-07-05 10:06:00',NULL);

