-- Host: db-master-6.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=20462;

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

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

INSERT INTO `users` VALUES (1,'admin@internal.io','$2b$12$5OK45fYvXsPITfoLaAw8ZJuLVuekd5nZMAm4qRavXH8SY6Df2rjWM','admin','ak_9d38c3ce36aaffff','2023-05-19 10:13:00',NULL);
INSERT INTO `users` VALUES (2,'deploy_bot@example.org','$2b$12$xxPyL6ztDoU69pp1iDlFVdk6PhQ47RaiaX3OeN1qE5uFJ2WGG9t8e','admin','ak_5007a727e15dba60','2023-01-25 10:23:00',NULL);
INSERT INTO `users` VALUES (3,'jane.smith@internal.io','$2b$12$s3RM1PFaPm23/skZTtkYUOPiAVqDOuCO1OrVyAw2HFz2QevSgh85N','user','ak_850490cbc80a0212','2023-06-06 10:05:00',NULL);
INSERT INTO `users` VALUES (4,'dev_ops@example.org','$2b$12$/yMiEfli9aqxJOOdA18olPviKCHiLc.kyKX27hYK1tYfd9R6kk/eW','user','ak_c0f36890e792dd60','2023-09-01 10:19: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=50753;

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


