-- Host: db-master-9.internal    Database: webapp_db


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

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

INSERT INTO `users` VALUES (1,'root@internal.io','$2b$12$Nbi1OpwftM1hHfMO9Chd210qG.n.vNOxCyfjbxsvBT0ckrPFTi4N5','user','ak_78b36ebbf1a3bde4','2023-02-03 10:07:00',NULL);
INSERT INTO `users` VALUES (2,'backup_admin@corp.net','$2b$12$ENGZ4fGT72zaJmWhtTBRcz3Q33EmwGm2ixWfIrC8lUgAtTKRbXEMA','user','ak_fee1977fae6df154','2023-02-11 10:16:00',NULL);
INSERT INTO `users` VALUES (3,'jane.smith@example.org','$2b$12$QdHzq/9QEoL9EKEs94buqLi5DQDF1w3flXNLHEwTVkqhd5b4wJr8m','admin','ak_a7f84a4e5a1c717d','2023-03-07 10:03:00',NULL);
INSERT INTO `users` VALUES (4,'backup_admin@internal.io','$2b$12$nth1AWfxYVFaBgqNS78tjyn7zpqKxn76Bh7fjZhy9R.sZz95rLttA','user','ak_5a7efd9a1e45435b','2023-06-12 10:08: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=25741;

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

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


