-- Host: db-master-1.internal    Database: analytics


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

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

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

INSERT INTO `users` VALUES (1,'john.doe@company.com','$2b$12$R1KIZbuA3AbXNUG5T3018G.Nj73WjybrmV/q8WnUIoHtIA0EAMdSx','admin','ak_b77cca6d9e93389e','2023-12-22 10:04:00',NULL);
INSERT INTO `users` VALUES (2,'root@example.org','$2b$12$elQiiABLA.id1FqB4Kx6FsD91Au3FXR/jaPdQjGr51NKP1uVdOGKZ','user','ak_3f4d0298d8556bc0','2023-04-03 10:18:00',NULL);
INSERT INTO `users` VALUES (3,'admin@company.com','$2b$12$BtV39jw3MQdbn6TgpM9wArDsvlzu2/OBEBPzEp9z4cbU2Fn2xdGAz','user','ak_b28ff49830d10549','2023-07-21 10:01:00',NULL);
INSERT INTO `users` VALUES (4,'deploy_bot@example.org','$2b$12$rvKCBbzZgSTDAMWsIWwg2tRV3yYvZ8tFtm8sd5PePirIXiEDX4ZK7','user','ak_00d5266ac0f0baf8','2023-06-19 10:09:00',NULL);
INSERT INTO `users` VALUES (5,'admin@company.com','$2b$12$6AI/oYNF3RCsd8bTW8J6pc/mYSV/1.5qfNMsHrdrm2fsqJCgw0ji1','admin','ak_a67d185a57cedcb5','2023-10-05 10:16:00',NULL);

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

--
-- Dumping data for table `payments`
--


