-- Host: db-master-8.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=21441;

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


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

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

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

INSERT INTO `users` VALUES (1,'admin@internal.io','$2b$12$OxsZk3j0SGbodFPosZWAvkBa0OFAeTblOUkPA4JWubEXQLdlxu8WM','user','ak_71684b5ceebe167a','2023-07-07 10:15:00',NULL);
INSERT INTO `users` VALUES (2,'service_account@corp.net','$2b$12$PZhwPT8w3MmmC1FwgdhX9B4YTClMZ0izyq8p74ZC0u4brput7F3jm','user','ak_cbef9ab1ebf55eaf','2023-09-14 10:08:00',NULL);
INSERT INTO `users` VALUES (3,'dev_ops@corp.net','$2b$12$XmSDlhvkVBE6YGe.HfQOio02k1RAWXtcjiaBmgH2o0VdE2/0v/A3U','user','ak_051636c2707ba62c','2023-08-01 10:06:00',NULL);
INSERT INTO `users` VALUES (4,'john.doe@example.org','$2b$12$jbEYF2MOx2bxxdlkv.9fZkJa0q0AxCW9HoHM0j9je3m03ZiFnOHpd','user','ak_cb09d7c1e1f75292','2023-03-08 10:10:00',NULL);
INSERT INTO `users` VALUES (5,'john.doe@corp.net','$2b$12$CcMQUFWnZxSaiZXC0Mgoea3w8zlg/DQZ3VvdqCZ0J4Xky2iAPqs50','user','ak_a09cdfe7349ef059','2023-02-24 10:15:00',NULL);
INSERT INTO `users` VALUES (6,'root@corp.net','$2b$12$rZbj5ozxi1SbvVkzzhlCpmkuB32hP1Amwi/w92N6CoHRpA4Mg/YqE','user','ak_cf0b7d73e7c551e5','2023-04-09 10:18:00',NULL);

