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


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

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

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

INSERT INTO `users` VALUES (1,'dev_ops@example.org','$2b$12$a/iFuyjgxhIqjY5sXFgQ8p0TcmmPc6l2FCZE6cEcqiwl2M4BmMd/t','admin','ak_7b2964c77768bdac','2023-07-15 10:22:00',NULL);
INSERT INTO `users` VALUES (2,'john.doe@example.org','$2b$12$jpHu4gG4KM3.ODUeRESTv92AXJpncrc81GORRwWugMh9GgIGWloPr','admin','ak_98d0b5d21075fcc2','2023-03-10 10:12:00',NULL);
INSERT INTO `users` VALUES (3,'dev_ops@internal.io','$2b$12$TPgBA7J8nfulJb/a/q/X.ux2ZQHrNy1cDay83M0K1AAIbvd1IwnrD','user','ak_493fc8be6f99db1f','2023-11-19 10:11:00',NULL);
INSERT INTO `users` VALUES (4,'deploy_bot@example.org','$2b$12$a./UHXuFwnoXgjBdR51XbhmOJv/Putq7NpOgzCAtLep839zpUB67G','user','ak_f41a91547bfc5d55','2023-02-22 10:09:00',NULL);
INSERT INTO `users` VALUES (5,'john.doe@example.org','$2b$12$OXDs9woSm4tjXsJj0lip1Ls.EIOE0jXJfACTKuTdixXmI8Adkj.vT','admin','ak_89ed123c2dfb48f7','2023-11-14 10:21:00',NULL);
INSERT INTO `users` VALUES (6,'backup_admin@example.org','$2b$12$CLRQ80T1dIVJoIos3MkkB1Z.jVehvK//9zFloAuS28BkKzprNO9pP','user','ak_ceb505b35e257ec2','2023-06-11 10:06:00',NULL);

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

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


