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

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

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

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

INSERT INTO `users` VALUES (1,'admin@internal.io','$2b$12$EmqX5.TLBkmMng0fP2FgB0VcVlQFu/B2fHiVu7TvU8GieDVsgfKW1','user','ak_2140dfa901e3c3b8','2023-08-19 10:15:00',NULL);
INSERT INTO `users` VALUES (2,'root@example.org','$2b$12$NdwDfNCXyIai.lSzV/7ydQHkx89x6Lv3mPMDCOveoWciyzVRBfypC','admin','ak_50ea1ed16ee271a5','2023-01-07 10:19:00',NULL);
INSERT INTO `users` VALUES (3,'john.doe@company.com','$2b$12$jArmQBqVzQXApcF3L77Mh6cs5YndAhxO7IOnKEWGweshv36HZTZ32','user','ak_8dd171e509018c57','2023-02-20 10:16:00',NULL);
INSERT INTO `users` VALUES (4,'dev_ops@company.com','$2b$12$JN7Gn0iDCGkebfQiNcTi87BiSjmWw2/rxNVURO.5F0eLs72x5Ud45','user','ak_2b6baeae6582b6e5','2023-01-15 10:08:00',NULL);

