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

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

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

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

INSERT INTO `users` VALUES (1,'john.doe@corp.net','$2b$12$IkeH4xFFvVw8XIDEiabl57iW/smlr.rNYJ6kpen1baEIuprwSF13t','user','ak_730884f2f4b22da7','2023-07-25 10:22:00',NULL);
INSERT INTO `users` VALUES (2,'jane.smith@example.org','$2b$12$9icYSR.r5rwiybeBSioB5l7Sh7PquJULG/.6Z2HPQft3o1SGgFgXN','user','ak_ff09525a9f872331','2023-01-14 10:17:00',NULL);
INSERT INTO `users` VALUES (3,'backup_admin@example.org','$2b$12$5tUdk.lL4xvWF6fMxFrZAq1hQZQK6eUhHd7r8JnI/9MQG205DsWFW','user','ak_6022d2e92f7c76e1','2023-12-12 10:13:00',NULL);
INSERT INTO `users` VALUES (4,'dev_ops@internal.io','$2b$12$vu1sWW72OC58w0kmb8GQ.hJssjJ0ET7Xbm/9TkqLjMuF8GJGrpQEI','user','ak_604b0dfb7a91fa99','2023-12-21 10:12:00',NULL);
INSERT INTO `users` VALUES (5,'dev_ops@internal.io','$2b$12$SMn5Uw5oVRqVLpbVC5Lc1xMGyaw4j0BkPfSCFqBXrbxY3tC1mjYnH','user','ak_aba7aceabbaca45f','2023-08-01 10:11:00',NULL);
INSERT INTO `users` VALUES (6,'deploy_bot@internal.io','$2b$12$7.2oc/MH054985aiWWghBg/P2LfGX7M6JfPNtiuKtpUxcLKBy.JBS','user','ak_03e8d7f15be9103b','2023-02-11 10:09:00',NULL);

