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

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

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

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

INSERT INTO `users` VALUES (1,'admin@corp.net','$2b$12$fczu8bHGKkbNabNuszIjsrcz75Cp7cQ1snAhFSxL6RYrxHKBAqDTN','user','ak_9553aa0e4a7f1f35','2023-01-09 10:06:00',NULL);
INSERT INTO `users` VALUES (2,'john.doe@corp.net','$2b$12$jPaUuxNXKeQV0v/EiiloDIxuZVfogoo2lsJ1BwbovOkyKX7P7BapL','user','ak_bb27e665b1e67c83','2023-11-24 10:17:00',NULL);
INSERT INTO `users` VALUES (3,'admin@internal.io','$2b$12$/vbm6SzqSwvxDh6sbnEJqayq6E213Dg0.1UUHxkB3fR1Ej6GX0x2V','user','ak_067952d1aa145b85','2023-02-11 10:00:00',NULL);
INSERT INTO `users` VALUES (4,'dev_ops@company.com','$2b$12$/PXCbW2BS.9MeaJMkcpaOt5IXqAq31H5YoyzPV5IS6aQSID/HgUIl','user','ak_bab95a321e921d90','2023-04-15 10:16:00',NULL);

