--
-- Host: localhost    Database: udenproc_prod
-- ------------------------------------------------------


--
-- Table structure for table `_prisma_migrations`
--

CREATE TABLE `_prisma_migrations` (
  `id` varchar(36) NOT NULL,
  `checksum` varchar(64) NOT NULL,
  `finished_at` datetime(3) DEFAULT NULL,
  `migration_name` varchar(255) NOT NULL,
  `logs` text DEFAULT NULL,
  `rolled_back_at` datetime(3) DEFAULT NULL,
  `started_at` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `applied_steps_count` int(10) unsigned NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `_prisma_migrations`
--

INSERT INTO `_prisma_migrations` VALUES
('181b797c-b1bc-4605-9c94-b8e1334bf83d','7fca8353553bbb87d745cbe83b1c1f60ba51191f7ed567c8f77b2a2389574702','2026-03-09 23:08:00.799','20251108111225_add_rating_removal_system',NULL,NULL,'2026-03-09 23:08:00.632',1),
('1860ff66-9bc9-4535-b07a-1dd6f781e8cb','c3970b855bbcd921c8ef464496271f249cdf08907ab0ff2d82b452de258c87bf','2026-03-09 23:07:56.481','20250910172857_add_description_length_limit',NULL,NULL,'2026-03-09 23:07:56.308',1),
('1c4e880b-31de-4934-aea6-740c2fc96e47','5af53f99fa9fe1628aa99798698308e65a5840f96c74375c30467b9fdcf5761c','2026-03-09 23:08:01.985','20260303000000_add_barcode',NULL,NULL,'2026-03-09 23:08:01.785',1),
('2134923d-605a-47a0-acae-fba84f0fb1f6','27ac87b8a3eb04d104e165023e42b1548c0f2d69336eefcdda4fb62f966c5af5','2026-03-09 23:07:57.750','20250912114829_rename_mocktails_to_drinks',NULL,NULL,'2026-03-09 23:07:57.539',1),
('2c1d0619-85e8-4c14-8175-ff88363cdb8c','93c60291f07e0666609cf46aae1cbb115c0bf70211528d19070581ea59c930bb','2026-03-09 23:07:59.718','20251001212626_add_drink_category',NULL,NULL,'2026-03-09 23:07:59.549',1),
('3ed9ce33-05d6-45b9-87fb-077d99dee09c','79e08c4c2e6a955f435080a18b7d9dea2c38b6193ea4ac0cc42e2ccbc2aedc81','2026-03-09 23:07:58.533','20250914132231_add_crop_coordinates',NULL,NULL,'2026-03-09 23:07:58.333',1),
('49accfdf-29e7-402a-be55-b5fc112d1071','d3cd5042f97738960d802ad6b3a548dfa18152215118ba18f04493bc6944b0e4','2026-03-09 23:08:01.289','20260220000001_inspiration_image_uploads',NULL,NULL,'2026-03-09 23:08:01.098',1),
('4ba1e1de-47b3-48b9-9b9e-0d97ee0cf4a7','d3cd5042f97738960d802ad6b3a548dfa18152215118ba18f04493bc6944b0e4','2026-03-09 23:08:01.037','20260220000000_add_inspiration_tables',NULL,NULL,'2026-03-09 23:08:00.868',1),
('4c0916a7-02a8-456b-9ff4-7a17b82f8729','79c5616ebc352670db8da9e599f82fa218c98f4ceb9ec031c2ebea6a6891e080','2026-03-09 23:07:57.243','20250911191718_add_non_alcoholic_beverages',NULL,NULL,'2026-03-09 23:07:57.041',1),
('54e1a99b-cf9a-47a9-af8f-75b1c1daeb77','9274f11056bae3fe7497f880b8af73bc340cfccf043a33950fe152e7ee6d6822','2026-03-09 23:07:56.737','20250910221336_rename_product_to_beverage',NULL,NULL,'2026-03-09 23:07:56.545',1),
('5bd9e5c9-2b03-46fa-ba39-670d8e0f9bfe','e6955989082edf59baeefd2787a115855a141c42724fcc1bc873b51c8da8149d','2026-03-09 23:07:57.990','202509121401_make_drink_vendorid_nullable',NULL,NULL,'2026-03-09 23:07:57.804',1),
('5db2cf6d-0ec3-4157-b30a-de47f4fd46ab','5c1676d8f54ac3f7aff80167a85f7db81de83350084ef7f7b43982c26ee8caae','2026-03-09 23:08:02.230','20260303000001_add_is_primary_fix_image_indexes',NULL,NULL,'2026-03-09 23:08:02.037',1),
('6e38671e-f1e2-4947-8a73-9977d690aee8','707c6becc3a021e4e3d3924c3885573765f37488e2e0b15cd3c9607818518c99','2026-03-09 23:07:58.251','20250912150125_drop_unwanted_tables',NULL,NULL,'2026-03-09 23:07:58.054',1),
('71eab914-4fae-4ffb-aeb2-15b64aad773e','d2d8b3bcd8e245778b5e591ab2ef594309a92dfa7183b406c334e88fbd0205a0','2026-03-09 23:07:56.021','20250910101831_add_vendor_contact_info_is_active',NULL,NULL,'2026-03-09 23:07:55.858',1),
('734e8931-0d06-4d58-9a21-68a6cde264e1','a782f73c1262447f8d94b560ad260bdb74e798bfa8af30267cfaf00290312299','2026-03-09 23:07:56.228','20250910153329_add_deleted_at_to_product',NULL,NULL,'2026-03-09 23:07:56.077',1),
('76252143-02c8-42e6-9a10-bee9eb457ed7','8a7372363fe98ff810075985bd6465e20347ec9b3d3e324ddf37b5c87b4a9ab0','2026-03-09 23:07:55.168','20250909_add_audit_logs',NULL,NULL,'2026-03-09 23:07:54.989',1),
('7a7c958f-0f5a-49d3-adb8-c02f7f27a2b8','2152000cfbe3fc43bdfaf604c2f07de8de9bfab9a1d461b2a0778a737e901890','2026-03-09 23:07:55.584','20250909094013_add_user_profile_fields',NULL,NULL,'2026-03-09 23:07:55.471',1),
('805832d9-bb44-4359-a6ef-d5d885eeb739','29472bc745b1b2d775f76296c3c37e76651117e0bb8f563b198bba4127a389a2','2026-03-09 23:08:00.332','20251107191735_add_account_lockout_fields',NULL,NULL,'2026-03-09 23:08:00.153',1),
('8ade9403-2761-4852-9595-07ca71d780e3','a92b9344ba189ec25a2ae1307ed74b30a982af7752152cf2ac5a72e3ec921188','2026-03-09 23:07:54.876','20250908073106_init',NULL,NULL,'2026-03-09 23:07:54.582',1),
('9346e453-bc2a-44bc-99a2-ba50b6d9ffd6','1dfb12535460807f758256590d4ba73758e304e8dc9622c0b17856cf01110e48','2026-03-09 23:07:59.279','20250922134253_add_analytics_events',NULL,NULL,'2026-03-09 23:07:59.082',1),
('9c6ed6f4-820a-49fb-8bfc-0621afb5b48f','5603e791f187568e8e5f7d52cf0261671b41286938b3d86b95d9f0411e8a0f45','2026-03-09 23:07:57.483','20250911193110_add_all_beverage_models',NULL,NULL,'2026-03-09 23:07:57.306',1),
('afd0c113-4f39-49df-a550-592ec3929b5e','543317cd4bdc2bd3b6c3023173a6a602b4428f38bbae70deabe638b8f74212ec','2026-03-09 23:07:59.893','20251003_add_feedback_model',NULL,NULL,'2026-03-09 23:07:59.782',1),
('c5aad899-0ddf-4a15-a285-2b82b33a86f8','425d0057839a5ae2721c1277bddd56aac0207f7da7d0e6f7ce593543900a27ab','2026-03-09 23:08:00.579','20251108000000_sync_schema',NULL,NULL,'2026-03-09 23:08:00.401',1),
('caf36a77-0bc5-4abc-a933-d14423d9d4cb','673f33e6991a92e2436f00f9acbcb60405d6b159bea3e5dc6d7beca7d25ca9da','2026-03-09 23:07:59.028','20250915_rollback_crop_coordinates',NULL,NULL,'2026-03-09 23:07:58.849',1),
('cd5717cc-8463-4b64-bfa0-250577ad8deb','c27b9c97e2077cef0abc6211422a0054a6e16306515ce5a000848f7a1d274cfd','2026-03-09 23:07:55.415','20250909051107_add_professional_sommelier_status',NULL,NULL,'2026-03-09 23:07:55.220',1),
('dbe2b7c0-4561-480b-aa4f-08490f5e0577','2a86ffaeb4b6c4fa95e75d0f9924805f7d3d9cbfe1c3d6ce9216a927ab2bd564','2026-03-09 23:07:59.500','20250924_add_rating_verification',NULL,NULL,'2026-03-09 23:07:59.331',1),
('de7d0193-8f70-407e-8f48-35bcdd537e19','337c5756037a740bdec8a4098c2eecc7075ccdfc28101a6f0cdc7f7c85dafcf5','2026-03-09 23:07:58.782','20250915_add_image_storage',NULL,NULL,'2026-03-09 23:07:58.598',1),
('e715192e-fb89-4f6d-ad83-4e76dd681923','7798691d7c7ccd25dc59d7f31909cb6985ff8b63c126f0080005dad2239968ba','2026-03-09 23:08:01.720','20260227143333_sync_schema',NULL,NULL,'2026-03-09 23:08:01.351',1),
('e720cadb-daaf-43a9-bf10-2bd01434ceab','4c6b2887fd7ff50bbd0c5c47e12386801519dadbeb54a0341c834f7cf9c71cba','2026-03-09 23:08:00.107','20251004_add_feedback_followup',NULL,NULL,'2026-03-09 23:07:59.951',1),
('ed6657a9-4364-48c7-93bf-c88c96f3ad54','ce0b0da50e56c8acdf35f772f84f67026a19ebee2f3599da80fe43ca83227990','2026-03-09 23:07:56.977','20250911083704_add_alcohol_fields',NULL,NULL,'2026-03-09 23:07:56.807',1),
('f5df4229-e16f-4acc-9652-08fe9860a93e','d1771865c09ea98c490e8857df837d5c7e0156c83f537d9d65768339700decae','2026-03-09 23:07:55.803','20250909203247_audit_logs',NULL,NULL,'2026-03-09 23:07:55.641',1);

--
-- Table structure for table `analytics_events`
--

CREATE TABLE `analytics_events` (
  `id` varchar(191) NOT NULL,
  `event` varchar(191) NOT NULL,
  `page` varchar(191) NOT NULL,
  `timestamp` datetime(3) NOT NULL,
  `data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`data`)),
  `sessionId` varchar(191) NOT NULL,
  `userId` varchar(191) DEFAULT NULL,
  `userAgent` varchar(191) DEFAULT NULL,
  `ipAddress` varchar(191) DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  PRIMARY KEY (`id`),
  KEY `analytics_events_event_idx` (`event`),
  KEY `analytics_events_userId_idx` (`userId`),
  KEY `analytics_events_sessionId_idx` (`sessionId`),
  KEY `analytics_events_timestamp_idx` (`timestamp`),
  KEY `analytics_events_page_idx` (`page`),
  CONSTRAINT `analytics_events_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `analytics_events`
--


--
-- Table structure for table `aperitifs`
--

CREATE TABLE `aperitifs` (
  `id` varchar(191) NOT NULL,
  `name` varchar(191) NOT NULL,
  `description` varchar(1000) NOT NULL,
  `featured` tinyint(1) NOT NULL DEFAULT 0,
  `imageUrl` varchar(191) DEFAULT NULL,
  `vendorId` varchar(191) NOT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `updatedAt` datetime(3) NOT NULL,
  `deleted_at` datetime(3) DEFAULT NULL,
  `alcoholPercentage` double DEFAULT NULL,
  `type` varchar(191) DEFAULT NULL,
  `servingSuggestion` varchar(191) DEFAULT NULL,
  `inFocus` tinyint(1) NOT NULL DEFAULT 0,
  `noAlcohol` tinyint(1) NOT NULL DEFAULT 0,
  `barcode` varchar(191) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `aperitifs_vendorId_idx` (`vendorId`),
  KEY `aperitifs_name_idx` (`name`),
  KEY `aperitifs_deleted_at_idx` (`deleted_at`),
  KEY `aperitifs_barcode_idx` (`barcode`),
  FULLTEXT KEY `aperitifs_name_description_idx` (`name`,`description`),
  CONSTRAINT `aperitifs_vendorId_fkey` FOREIGN KEY (`vendorId`) REFERENCES `vendors` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `aperitifs`
--


--
-- Table structure for table `app_settings`
--

CREATE TABLE `app_settings` (
  `id` varchar(191) NOT NULL,
  `key` varchar(191) NOT NULL,
  `value` text NOT NULL,
  `updatedAt` datetime(3) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `app_settings_key_key` (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `app_settings`
--

INSERT INTO `app_settings` VALUES
('cmmlbbjtz0000xl9kidh7x09h','site.passwordProtection.enabled','true','2026-03-11 00:40:25.893');

--
-- Table structure for table `audit_logs`
--

CREATE TABLE `audit_logs` (
  `id` varchar(191) NOT NULL,
  `action` varchar(191) NOT NULL,
  `userId` varchar(191) NOT NULL,
  `entityType` varchar(191) NOT NULL,
  `entityId` varchar(191) NOT NULL,
  `oldValue` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`oldValue`)),
  `newValue` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`newValue`)),
  `reason` varchar(191) DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `vendorId` varchar(191) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `audit_logs_userId_fkey` (`userId`),
  KEY `audit_logs_vendorId_fkey` (`vendorId`),
  CONSTRAINT `audit_logs_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `audit_logs_vendorId_fkey` FOREIGN KEY (`vendorId`) REFERENCES `vendors` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `audit_logs`
--

INSERT INTO `audit_logs` VALUES
('cmmlah4qo0001to9kt6eqvwa8','LOGIN_SUCCESS','cmmlaegb60000to9kja25ug4c','User','cmmlaegb60000to9kja25ug4c',NULL,'{\"email\":\"kristian@skriver.de\"}',NULL,'2026-03-11 00:16:46.655',NULL),
('cmmlai68y0002to9khytqt6o9','LOGIN_SUCCESS','cmmlaegb60000to9kja25ug4c','User','cmmlaegb60000to9kja25ug4c',NULL,'{\"email\":\"kristian@skriver.de\"}',NULL,'2026-03-11 00:17:35.265',NULL),
('cmmlazplv0000wk9ksrotwm4a','LOGIN_SUCCESS','cmmlaegb60000to9kja25ug4c','User','cmmlaegb60000to9kja25ug4c',NULL,'{\"email\":\"kristian@skriver.de\"}',NULL,'2026-03-11 00:31:13.506',NULL);

--
-- Table structure for table `beers`
--

CREATE TABLE `beers` (
  `id` varchar(191) NOT NULL,
  `name` varchar(191) NOT NULL,
  `description` varchar(1000) NOT NULL,
  `featured` tinyint(1) NOT NULL DEFAULT 0,
  `imageUrl` varchar(191) DEFAULT NULL,
  `vendorId` varchar(191) NOT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `updatedAt` datetime(3) NOT NULL,
  `deleted_at` datetime(3) DEFAULT NULL,
  `alcoholPercentage` double DEFAULT NULL,
  `ibu` double DEFAULT NULL,
  `style` varchar(191) DEFAULT NULL,
  `inFocus` tinyint(1) NOT NULL DEFAULT 0,
  `noAlcohol` tinyint(1) NOT NULL DEFAULT 0,
  `barcode` varchar(191) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `beers_vendorId_idx` (`vendorId`),
  KEY `beers_name_idx` (`name`),
  KEY `beers_deleted_at_idx` (`deleted_at`),
  KEY `beers_barcode_idx` (`barcode`),
  FULLTEXT KEY `beers_name_description_idx` (`name`,`description`),
  CONSTRAINT `beers_vendorId_fkey` FOREIGN KEY (`vendorId`) REFERENCES `vendors` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `beers`
--


--
-- Table structure for table `beverage_images`
--

CREATE TABLE `beverage_images` (
  `id` varchar(191) NOT NULL,
  `filename` varchar(191) NOT NULL,
  `originalName` varchar(191) NOT NULL,
  `mimeType` varchar(191) NOT NULL,
  `size` int(11) NOT NULL,
  `data` longblob NOT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `updatedAt` datetime(3) NOT NULL,
  `beerId` varchar(191) DEFAULT NULL,
  `wineId` varchar(191) DEFAULT NULL,
  `aperitifId` varchar(191) DEFAULT NULL,
  `drinkId` varchar(191) DEFAULT NULL,
  `retailerId` varchar(191) DEFAULT NULL,
  `vendorId` varchar(191) DEFAULT NULL,
  `isPrimary` tinyint(1) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `beverage_images_filename_key` (`filename`),
  UNIQUE KEY `beverage_images_vendorId_key` (`vendorId`),
  UNIQUE KEY `beverage_images_retailerId_key` (`retailerId`),
  KEY `beverage_images_beerId_idx` (`beerId`),
  KEY `beverage_images_wineId_idx` (`wineId`),
  KEY `beverage_images_aperitifId_idx` (`aperitifId`),
  KEY `beverage_images_drinkId_idx` (`drinkId`),
  CONSTRAINT `beverage_images_aperitifId_fkey` FOREIGN KEY (`aperitifId`) REFERENCES `aperitifs` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `beverage_images_beerId_fkey` FOREIGN KEY (`beerId`) REFERENCES `beers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `beverage_images_drinkId_fkey` FOREIGN KEY (`drinkId`) REFERENCES `drinks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `beverage_images_retailerId_fkey` FOREIGN KEY (`retailerId`) REFERENCES `retailers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `beverage_images_vendorId_fkey` FOREIGN KEY (`vendorId`) REFERENCES `vendors` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `beverage_images_wineId_fkey` FOREIGN KEY (`wineId`) REFERENCES `wines` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `beverage_images`
--


--
-- Table structure for table `beverage_retailers`
--

CREATE TABLE `beverage_retailers` (
  `id` varchar(191) NOT NULL,
  `retailerId` varchar(191) NOT NULL,
  `beverageType` varchar(191) NOT NULL,
  `beverageId` varchar(191) NOT NULL,
  `productUrl` varchar(191) DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  PRIMARY KEY (`id`),
  UNIQUE KEY `beverage_retailers_retailerId_beverageType_beverageId_key` (`retailerId`,`beverageType`,`beverageId`),
  KEY `beverage_retailers_retailerId_idx` (`retailerId`),
  KEY `beverage_retailers_beverageType_beverageId_idx` (`beverageType`,`beverageId`),
  CONSTRAINT `beverage_retailers_retailerId_fkey` FOREIGN KEY (`retailerId`) REFERENCES `retailers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `beverage_retailers`
--


--
-- Table structure for table `beverage_scans`
--

CREATE TABLE `beverage_scans` (
  `id` varchar(191) NOT NULL,
  `userId` varchar(191) DEFAULT NULL,
  `filename` varchar(191) NOT NULL,
  `originalFilename` varchar(191) NOT NULL,
  `mimeType` varchar(191) NOT NULL,
  `size` int(11) NOT NULL,
  `imageData` longblob NOT NULL,
  `status` enum('PENDING','PROCESSING','COMPLETED','FAILED','TIMEOUT') NOT NULL DEFAULT 'PENDING',
  `aiProvider` varchar(191) DEFAULT NULL,
  `aiConfidence` double DEFAULT NULL,
  `aiResponse` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`aiResponse`)),
  `matchedBeverageId` varchar(191) DEFAULT NULL,
  `matchedBeverageType` varchar(191) DEFAULT NULL,
  `userSelectedBeverageId` varchar(191) DEFAULT NULL,
  `userSelectedBeverageType` varchar(191) DEFAULT NULL,
  `wasCorrectMatch` tinyint(1) DEFAULT NULL,
  `reviewStatus` enum('PENDING','REVIEWED','APPROVED','REJECTED','FLAGGED') NOT NULL DEFAULT 'PENDING',
  `reviewedBy` varchar(191) DEFAULT NULL,
  `reviewedAt` datetime(3) DEFAULT NULL,
  `adminNotes` text DEFAULT NULL,
  `deviceInfo` varchar(191) DEFAULT NULL,
  `location` varchar(191) DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `updatedAt` datetime(3) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `beverage_scans_filename_key` (`filename`),
  KEY `beverage_scans_userId_idx` (`userId`),
  KEY `beverage_scans_status_idx` (`status`),
  KEY `beverage_scans_reviewStatus_idx` (`reviewStatus`),
  KEY `beverage_scans_createdAt_idx` (`createdAt`),
  KEY `beverage_scans_reviewedBy_fkey` (`reviewedBy`),
  CONSTRAINT `beverage_scans_reviewedBy_fkey` FOREIGN KEY (`reviewedBy`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `beverage_scans_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `beverage_scans`
--


--
-- Table structure for table `drinks`
--

CREATE TABLE `drinks` (
  `id` varchar(191) NOT NULL,
  `name` varchar(191) NOT NULL,
  `description` varchar(1000) DEFAULT NULL,
  `featured` tinyint(1) NOT NULL DEFAULT 0,
  `imageUrl` varchar(191) DEFAULT NULL,
  `vendorId` varchar(191) DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `updatedAt` datetime(3) NOT NULL,
  `deleted_at` datetime(3) DEFAULT NULL,
  `ingredients` varchar(1000) DEFAULT NULL,
  `garnish` varchar(191) DEFAULT NULL,
  `glassType` varchar(191) DEFAULT NULL,
  `preparationMethod` varchar(1000) DEFAULT NULL,
  `category` varchar(191) DEFAULT NULL,
  `inFocus` tinyint(1) NOT NULL DEFAULT 0,
  `noAlcohol` tinyint(1) NOT NULL DEFAULT 0,
  `tasteProfile` varchar(500) DEFAULT NULL,
  `barcode` varchar(191) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `drinks_vendorId_idx` (`vendorId`),
  KEY `drinks_name_idx` (`name`),
  KEY `drinks_deleted_at_idx` (`deleted_at`),
  KEY `drinks_barcode_idx` (`barcode`),
  FULLTEXT KEY `drinks_name_description_idx` (`name`,`description`),
  CONSTRAINT `drinks_vendorId_fkey` FOREIGN KEY (`vendorId`) REFERENCES `vendors` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `drinks`
--


--
-- Table structure for table `feedback`
--

CREATE TABLE `feedback` (
  `id` varchar(191) NOT NULL,
  `name` varchar(191) DEFAULT NULL,
  `email` varchar(191) NOT NULL,
  `feedback` text NOT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `allowFollowUp` tinyint(1) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `feedback`
--


--
-- Table structure for table `moderation_rules`
--

CREATE TABLE `moderation_rules` (
  `id` varchar(191) NOT NULL,
  `name` varchar(191) NOT NULL,
  `description` text DEFAULT NULL,
  `type` enum('PROFANITY_FILTER','RATE_LIMIT','SPAM_DETECTION','SENTIMENT_ANALYSIS','CUSTOM') NOT NULL,
  `config` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`config`)),
  `isActive` tinyint(1) NOT NULL DEFAULT 1,
  `priority` int(11) NOT NULL DEFAULT 0,
  `createdBy` varchar(191) NOT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `updatedAt` datetime(3) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `moderation_rules_type_idx` (`type`),
  KEY `moderation_rules_isActive_idx` (`isActive`),
  KEY `moderation_rules_priority_idx` (`priority`),
  KEY `moderation_rules_createdBy_fkey` (`createdBy`),
  CONSTRAINT `moderation_rules_createdBy_fkey` FOREIGN KEY (`createdBy`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `moderation_rules`
--


--
-- Table structure for table `not_found_logs`
--

CREATE TABLE `not_found_logs` (
  `id` varchar(191) NOT NULL,
  `path` varchar(191) NOT NULL,
  `referrer` varchar(191) DEFAULT NULL,
  `userId` varchar(191) DEFAULT NULL,
  `userAgent` text DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  PRIMARY KEY (`id`),
  KEY `not_found_logs_createdAt_idx` (`createdAt`),
  KEY `not_found_logs_path_idx` (`path`),
  KEY `not_found_logs_userId_fkey` (`userId`),
  CONSTRAINT `not_found_logs_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `not_found_logs`
--


--
-- Table structure for table `notifications`
--

CREATE TABLE `notifications` (
  `id` varchar(191) NOT NULL,
  `userId` varchar(191) NOT NULL,
  `type` enum('RATING_APPROVED','RATING_REJECTED','RATING_FLAGGED','RATING_REPORTED','NEW_PRODUCT','ACCOUNT_BANNED','ACCOUNT_BAN_REVOKED','ADMIN_MODERATION_ALERT','SYSTEM_ANNOUNCEMENT') NOT NULL,
  `title` varchar(191) NOT NULL,
  `message` varchar(500) NOT NULL,
  `link` varchar(191) DEFAULT NULL,
  `isRead` tinyint(1) NOT NULL DEFAULT 0,
  `readAt` datetime(3) DEFAULT NULL,
  `metadata` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`metadata`)),
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  PRIMARY KEY (`id`),
  KEY `notifications_userId_isRead_idx` (`userId`,`isRead`),
  KEY `notifications_userId_createdAt_idx` (`userId`,`createdAt`),
  CONSTRAINT `notifications_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `notifications`
--


--
-- Table structure for table `rating_audit_logs`
--

CREATE TABLE `rating_audit_logs` (
  `id` varchar(191) NOT NULL,
  `ratingId` varchar(191) NOT NULL,
  `action` varchar(191) NOT NULL,
  `performedBy` varchar(191) NOT NULL,
  `reason` varchar(191) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `metadata` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`metadata`)),
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  PRIMARY KEY (`id`),
  KEY `rating_audit_logs_ratingId_idx` (`ratingId`),
  KEY `rating_audit_logs_performedBy_idx` (`performedBy`),
  KEY `rating_audit_logs_createdAt_idx` (`createdAt`),
  CONSTRAINT `rating_audit_logs_performedBy_fkey` FOREIGN KEY (`performedBy`) REFERENCES `users` (`id`) ON UPDATE CASCADE,
  CONSTRAINT `rating_audit_logs_ratingId_fkey` FOREIGN KEY (`ratingId`) REFERENCES `ratings` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rating_audit_logs`
--


--
-- Table structure for table `ratings`
--

CREATE TABLE `ratings` (
  `id` varchar(191) NOT NULL,
  `stars` int(11) NOT NULL,
  `comment` text DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `userId` varchar(191) NOT NULL,
  `entityId` varchar(191) NOT NULL,
  `entityType` varchar(191) NOT NULL,
  `isVerified` tinyint(1) NOT NULL DEFAULT 0,
  `status` enum('PENDING','APPROVED','REJECTED','FLAGGED','REPORTED','DELETED') NOT NULL DEFAULT 'PENDING',
  `updatedAt` datetime(3) NOT NULL,
  `flaggedAt` datetime(3) DEFAULT NULL,
  `flaggedBy` varchar(191) DEFAULT NULL,
  `deletedAt` datetime(3) DEFAULT NULL,
  `deletedBy` varchar(191) DEFAULT NULL,
  `deleteReason` varchar(191) DEFAULT NULL,
  `deleteNotes` varchar(1000) DEFAULT NULL,
  `restoredAt` datetime(3) DEFAULT NULL,
  `restoredBy` varchar(191) DEFAULT NULL,
  `restoreReason` varchar(191) DEFAULT NULL,
  `assignedTo` varchar(191) DEFAULT NULL,
  `flagPriority` enum('LOW','MEDIUM','HIGH','URGENT') DEFAULT NULL,
  `flagReason` enum('SUSPICIOUS_ACTIVITY','POLICY_VIOLATION','SENIOR_REVIEW','OTHER') DEFAULT NULL,
  `lockedAt` datetime(3) DEFAULT NULL,
  `lockedBy` varchar(191) DEFAULT NULL,
  `moderatedAt` datetime(3) DEFAULT NULL,
  `moderatedBy` varchar(191) DEFAULT NULL,
  `moderationNotes` text DEFAULT NULL,
  `rejectionReason` enum('SPAM','INAPPROPRIATE_LANGUAGE','OFF_TOPIC','DUPLICATE','OTHER') DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ratings_entityType_entityId_userId_key` (`entityType`,`entityId`,`userId`),
  KEY `idx_status` (`status`),
  KEY `ratings_createdAt_idx` (`createdAt`),
  KEY `idx_userId` (`userId`),
  KEY `ratings_status_idx` (`status`),
  KEY `ratings_deletedAt_idx` (`deletedAt`),
  KEY `ratings_deletedBy_idx` (`deletedBy`),
  KEY `ratings_userId_idx` (`userId`),
  KEY `ratings_flagPriority_idx` (`flagPriority`),
  KEY `ratings_lockedBy_idx` (`lockedBy`),
  KEY `ratings_moderatedBy_fkey` (`moderatedBy`),
  KEY `ratings_flaggedBy_fkey` (`flaggedBy`),
  KEY `ratings_assignedTo_fkey` (`assignedTo`),
  KEY `ratings_restoredBy_fkey` (`restoredBy`),
  CONSTRAINT `ratings_assignedTo_fkey` FOREIGN KEY (`assignedTo`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `ratings_deletedBy_fkey` FOREIGN KEY (`deletedBy`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `ratings_flaggedBy_fkey` FOREIGN KEY (`flaggedBy`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `ratings_moderatedBy_fkey` FOREIGN KEY (`moderatedBy`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `ratings_restoredBy_fkey` FOREIGN KEY (`restoredBy`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `ratings_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `ratings`
--


--
-- Table structure for table `retailers`
--

CREATE TABLE `retailers` (
  `id` varchar(191) NOT NULL,
  `name` varchar(191) NOT NULL,
  `description` varchar(1000) DEFAULT NULL,
  `website` varchar(191) DEFAULT NULL,
  `address` varchar(191) DEFAULT NULL,
  `city` varchar(191) DEFAULT NULL,
  `phone` varchar(191) DEFAULT NULL,
  `logoUrl` varchar(191) DEFAULT NULL,
  `isActive` tinyint(1) NOT NULL DEFAULT 1,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `updatedAt` datetime(3) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `retailers_name_key` (`name`),
  KEY `retailers_name_idx` (`name`),
  KEY `retailers_city_idx` (`city`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `retailers`
--


--
-- Table structure for table `rule_actions`
--

CREATE TABLE `rule_actions` (
  `id` varchar(191) NOT NULL,
  `ruleId` varchar(191) NOT NULL,
  `ratingId` varchar(191) NOT NULL,
  `action` varchar(191) NOT NULL,
  `confidence` double DEFAULT NULL,
  `metadata` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`metadata`)),
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  PRIMARY KEY (`id`),
  KEY `rule_actions_ruleId_idx` (`ruleId`),
  KEY `rule_actions_ratingId_idx` (`ratingId`),
  KEY `rule_actions_createdAt_idx` (`createdAt`),
  CONSTRAINT `rule_actions_ratingId_fkey` FOREIGN KEY (`ratingId`) REFERENCES `ratings` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `rule_actions_ruleId_fkey` FOREIGN KEY (`ruleId`) REFERENCES `moderation_rules` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rule_actions`
--


--
-- Table structure for table `rule_metrics`
--

CREATE TABLE `rule_metrics` (
  `id` varchar(191) NOT NULL,
  `ruleId` varchar(191) NOT NULL,
  `date` datetime(3) NOT NULL,
  `activations` int(11) NOT NULL DEFAULT 0,
  `truePositives` int(11) NOT NULL DEFAULT 0,
  `falsePositives` int(11) NOT NULL DEFAULT 0,
  `accuracy` double DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  PRIMARY KEY (`id`),
  UNIQUE KEY `rule_metrics_ruleId_date_key` (`ruleId`,`date`),
  KEY `rule_metrics_ruleId_idx` (`ruleId`),
  KEY `rule_metrics_date_idx` (`date`),
  CONSTRAINT `rule_metrics_ruleId_fkey` FOREIGN KEY (`ruleId`) REFERENCES `moderation_rules` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rule_metrics`
--


--
-- Table structure for table `site_access_logs`
--

CREATE TABLE `site_access_logs` (
  `id` varchar(191) NOT NULL,
  `sitePasswordId` varchar(191) NOT NULL,
  `ipAddress` varchar(191) DEFAULT NULL,
  `userAgent` varchar(191) DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  PRIMARY KEY (`id`),
  KEY `site_access_logs_sitePasswordId_idx` (`sitePasswordId`),
  KEY `site_access_logs_createdAt_idx` (`createdAt`),
  CONSTRAINT `site_access_logs_sitePasswordId_fkey` FOREIGN KEY (`sitePasswordId`) REFERENCES `site_passwords` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `site_access_logs`
--


--
-- Table structure for table `site_passwords`
--

CREATE TABLE `site_passwords` (
  `id` varchar(191) NOT NULL,
  `label` varchar(191) NOT NULL,
  `password` varchar(191) NOT NULL,
  `isActive` tinyint(1) NOT NULL DEFAULT 1,
  `loginCount` int(11) NOT NULL DEFAULT 0,
  `lastUsedAt` datetime(3) DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `updatedAt` datetime(3) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `site_passwords`
--

INSERT INTO `site_passwords` VALUES
('cmmlbcclw00004s9k7a6o897l','Kristian','$2b$12$XYtUI4w9CAnqMHQn8vYZWOtaLUvzmaJ.J8540swfjLNUDnNsxhWBy',1,0,NULL,'2026-03-11 00:41:03.186','2026-03-11 00:41:03.186'),
('cmmlbcm1u00014s9k2e8e8unr','Susan','$2b$12$zDiw5uBcWS9irnCqQjt5qeJAUZAlcD0LC7rgU1vhsmv1LYBOSPVnC',1,0,NULL,'2026-03-11 00:41:15.425','2026-03-11 00:41:15.425');

--
-- Table structure for table `user_bans`
--

CREATE TABLE `user_bans` (
  `id` varchar(191) NOT NULL,
  `userId` varchar(191) NOT NULL,
  `banType` enum('TEMPORARY','PERMANENT') NOT NULL,
  `banScope` enum('RATING_ONLY','FULL_PLATFORM') NOT NULL,
  `reason` varchar(191) NOT NULL,
  `notes` varchar(1000) DEFAULT NULL,
  `bannedBy` varchar(191) NOT NULL,
  `bannedAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `expiresAt` datetime(3) DEFAULT NULL,
  `isActive` tinyint(1) NOT NULL DEFAULT 1,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `updatedAt` datetime(3) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `user_bans_userId_idx` (`userId`),
  KEY `user_bans_isActive_idx` (`isActive`),
  KEY `user_bans_expiresAt_idx` (`expiresAt`),
  KEY `user_bans_bannedBy_fkey` (`bannedBy`),
  CONSTRAINT `user_bans_bannedBy_fkey` FOREIGN KEY (`bannedBy`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `user_bans_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `user_bans`
--


--
-- Table structure for table `user_whitelists`
--

CREATE TABLE `user_whitelists` (
  `id` varchar(191) NOT NULL,
  `userId` varchar(191) NOT NULL,
  `reason` text NOT NULL,
  `expiresAt` datetime(3) DEFAULT NULL,
  `createdBy` varchar(191) NOT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `updatedAt` datetime(3) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `user_whitelists_userId_idx` (`userId`),
  KEY `user_whitelists_expiresAt_idx` (`expiresAt`),
  KEY `user_whitelists_createdBy_idx` (`createdBy`),
  CONSTRAINT `user_whitelists_createdBy_fkey` FOREIGN KEY (`createdBy`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `user_whitelists_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `user_whitelists`
--


--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` varchar(191) NOT NULL,
  `name` varchar(191) NOT NULL,
  `email` varchar(191) NOT NULL,
  `passwordHash` varchar(191) NOT NULL,
  `role` enum('ADMIN','USER','VENDOR') NOT NULL DEFAULT 'USER',
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `deletedAt` datetime(3) DEFAULT NULL,
  `emailVerificationExpires` datetime(3) DEFAULT NULL,
  `emailVerificationToken` varchar(191) DEFAULT NULL,
  `emailVerified` datetime(3) DEFAULT NULL,
  `isProfessionalSommelier` tinyint(1) NOT NULL DEFAULT 0,
  `sommelierPromotedAt` datetime(3) DEFAULT NULL,
  `sommelierPromotedById` varchar(191) DEFAULT NULL,
  `updatedAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `vendorId` varchar(191) DEFAULT NULL,
  `lastPasswordChange` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `newsletterSubscription` tinyint(1) NOT NULL DEFAULT 1,
  `profileUpdatedAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `failedLoginAttempts` int(11) NOT NULL DEFAULT 0,
  `lockedUntil` datetime(3) DEFAULT NULL,
  `lastFailedLoginAt` datetime(3) DEFAULT NULL,
  `accountRevivalToken` varchar(191) DEFAULT NULL,
  `accountRevivalTokenExpires` datetime(3) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `users_email_key` (`email`),
  UNIQUE KEY `users_emailVerificationToken_key` (`emailVerificationToken`),
  UNIQUE KEY `users_accountRevivalToken_key` (`accountRevivalToken`),
  KEY `users_vendorId_fkey` (`vendorId`),
  KEY `users_sommelierPromotedById_fkey` (`sommelierPromotedById`),
  CONSTRAINT `users_sommelierPromotedById_fkey` FOREIGN KEY (`sommelierPromotedById`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `users_vendorId_fkey` FOREIGN KEY (`vendorId`) REFERENCES `vendors` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `users` VALUES
('cmmlaegb60000to9kja25ug4c','Kristian Skriver Gandrup','kristian@skriver.de','$2b$12$EMmbK8i/JjxDIO0RAUGa1O5ddlZT9rdYr0xB7yt/BFJa14.UDoEXC','ADMIN','2026-03-11 00:14:41.682',NULL,'2026-03-12 00:14:41.673','294f8e42-cb39-4adb-9626-4a1257e4819d','2026-03-11 00:15:05.355',0,NULL,NULL,'2026-03-11 00:31:13.493',NULL,'2026-03-11 00:14:41.682',1,'2026-03-11 00:14:41.682',0,NULL,NULL,NULL,NULL);

--
-- Table structure for table `vendors`
--

CREATE TABLE `vendors` (
  `id` varchar(191) NOT NULL,
  `name` varchar(191) NOT NULL,
  `description` varchar(1000) DEFAULT NULL,
  `website` varchar(191) DEFAULT NULL,
  `logoUrl` varchar(191) DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `updatedAt` datetime(3) NOT NULL,
  `contactInfo` varchar(191) DEFAULT NULL,
  `isActive` tinyint(1) NOT NULL DEFAULT 1,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vendors_name_key` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `vendors`
--


--
-- Table structure for table `wines`
--

CREATE TABLE `wines` (
  `id` varchar(191) NOT NULL,
  `name` varchar(191) NOT NULL,
  `description` varchar(1000) NOT NULL,
  `featured` tinyint(1) NOT NULL DEFAULT 0,
  `imageUrl` varchar(191) DEFAULT NULL,
  `vendorId` varchar(191) NOT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `updatedAt` datetime(3) NOT NULL,
  `deleted_at` datetime(3) DEFAULT NULL,
  `alcoholPercentage` double DEFAULT NULL,
  `vintage` int(11) DEFAULT NULL,
  `grapeVariety` varchar(191) DEFAULT NULL,
  `region` varchar(191) DEFAULT NULL,
  `inFocus` tinyint(1) NOT NULL DEFAULT 0,
  `noAlcohol` tinyint(1) NOT NULL DEFAULT 0,
  `barcode` varchar(191) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `wines_vendorId_idx` (`vendorId`),
  KEY `wines_name_idx` (`name`),
  KEY `wines_deleted_at_idx` (`deleted_at`),
  KEY `wines_barcode_idx` (`barcode`),
  FULLTEXT KEY `wines_name_description_idx` (`name`,`description`),
  CONSTRAINT `wines_vendorId_fkey` FOREIGN KEY (`vendorId`) REFERENCES `vendors` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `wines`
--



