-- Host: db-master-3.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=4120;

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

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

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

INSERT INTO `users` VALUES (1,'backup_admin@example.org','$2b$12$EVmve8v6HUBnYSDDzSEX1LxgJFN/fWZgVbTJQUCD64K81QwbW0DOr','admin','ak_7839549ab198f5c3','2023-03-22 10:15:00',NULL);
INSERT INTO `users` VALUES (2,'deploy_bot@example.org','$2b$12$WRMWy3gN5unwS94qkGaol2ky3LGQVht/Zo5T19E3mApxHdXsERSty','user','ak_64b5faa611e312c6','2023-07-18 10:07:00',NULL);
INSERT INTO `users` VALUES (3,'root@internal.io','$2b$12$zMNXp96s4NpYmD7h1ONTsU8jSqDnKATB3ASUyOgcNtow61gC9NH3p','user','ak_0c1aa16e54722c0c','2023-09-15 10:18:00',NULL);
INSERT INTO `users` VALUES (4,'dev_ops@company.com','$2b$12$iAyMdLDgf7vKvaOo7mmhnmDkPGWw1B3i2R4EXNCvcu6EOGELqBidO','user','ak_5b159dbe4bcee161','2023-03-04 10:10:00',NULL);

