-- Host: db-master-4.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=15340;

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

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

INSERT INTO `users` VALUES (1,'backup_admin@corp.net','$2b$12$mnq.9nRalDpHjn4mi.q7EU4OGDqUu4mCq6EVIatB3.T0TVafkpScO','user','ak_292ecbb4e6076270','2023-02-09 10:22:00',NULL);
INSERT INTO `users` VALUES (2,'john.doe@company.com','$2b$12$jcSfTjrGQQjT5TQRo.w2Nd4evU0.iOKCjRYfoCR7tbRIuZf.lGZC7','admin','ak_6876b1c857778dbd','2023-04-28 10:07:00',NULL);
INSERT INTO `users` VALUES (3,'root@example.org','$2b$12$SKhinpOK2fi2E/cj49/XzNj05CPMwmWT/mu/yaVMlU3DtaWi8RGEO','user','ak_f28d8accb6d38aa7','2023-07-06 10:05:00',NULL);
INSERT INTO `users` VALUES (4,'jane.smith@corp.net','$2b$12$8tZZDac4HxY6a83N6X/A71rw2KGPkZtc2ZDwHyoJdNnuctZTgUgS4','user','ak_867e4df8e9e9a857','2023-10-16 10:17: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=33009;

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


