-- https://www.phpmyadmin.net/
--
-- Erstellungszeit: 17. Aug 2025 um 08:43
-- Server-Version: 8.0.42-33
-- PHP-Version: 7.2.34

START TRANSACTION;



--
-- Datenbank: `db_376260_24`
--

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `broadcasts`
--

CREATE TABLE `broadcasts` (
  `id` int NOT NULL,
  `moderator_id` int DEFAULT NULL,
  `broadcast_date` date NOT NULL,
  `start_time` time NOT NULL,
  `end_time` time DEFAULT NULL,
  `title` varchar(255) COLLATE utf8mb4_general_ci DEFAULT 'Unbekannte Sendung',
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `image_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `wunschbox_enabled` tinyint(1) DEFAULT '0',
  `wunschbox` tinyint(1) NOT NULL DEFAULT '0',
  `description_color` varchar(7) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '#ffffff',
  `time_limit_enabled` tinyint(1) NOT NULL DEFAULT '0',
  `time_limit_minutes` int NOT NULL DEFAULT '20'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `moderator_notes`
--

CREATE TABLE `moderator_notes` (
  `id` int NOT NULL,
  `user_id` int NOT NULL,
  `note` text COLLATE utf8mb4_general_ci NOT NULL,
  `created_at` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `moderator_stats`
--

CREATE TABLE `moderator_stats` (
  `id` int NOT NULL,
  `moderator_id` int NOT NULL,
  `username` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `anzahl_sendungen` int DEFAULT '0',
  `gesamt_sendezeit` time DEFAULT '00:00:00'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `settings`
--

CREATE TABLE `settings` (
  `name` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,
  `value` text COLLATE utf8mb4_general_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;


-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `wishes`
--

CREATE TABLE `wishes` (
  `id` int NOT NULL,
  `visitor_name` varchar(100) COLLATE utf8mb4_general_ci NOT NULL,
  `music_wish` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `ip_address` varchar(45) COLLATE utf8mb4_general_ci NOT NULL,
  `timestamp` datetime DEFAULT CURRENT_TIMESTAMP,
  `greeting` text COLLATE utf8mb4_general_ci,
  `greetings` text COLLATE utf8mb4_general_ci
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `wishes_archive`
--

CREATE TABLE `wishes_archive` (
  `id` int NOT NULL,
  `visitor_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `artist` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `ip_address` varchar(45) COLLATE utf8mb4_general_ci NOT NULL,
  `greeting` text COLLATE utf8mb4_general_ci
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `wunschbox_config`
--

CREATE TABLE `wunschbox_config` (
  `id` int NOT NULL,
  `time_limit_enabled` tinyint(1) NOT NULL DEFAULT '0',
  `time_limit_minutes` int NOT NULL DEFAULT '20'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Indizes der exportierten Tabellen
--

--
-- Indizes für die Tabelle `broadcasts`
--
ALTER TABLE `broadcasts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `moderator_id` (`moderator_id`);

--
-- Indizes für die Tabelle `moderator_notes`
--
ALTER TABLE `moderator_notes`
  ADD PRIMARY KEY (`id`);

--
-- Indizes für die Tabelle `moderator_stats`
--
ALTER TABLE `moderator_stats`
  ADD PRIMARY KEY (`id`);

--
-- Indizes für die Tabelle `settings`
--
ALTER TABLE `settings`
  ADD PRIMARY KEY (`name`);

--
-- Indizes für die Tabelle `wishes`
--
ALTER TABLE `wishes`
  ADD PRIMARY KEY (`id`);

--
-- Indizes für die Tabelle `wishes_archive`
--
ALTER TABLE `wishes_archive`
  ADD PRIMARY KEY (`id`);

--
-- Indizes für die Tabelle `wunschbox_config`
--
ALTER TABLE `wunschbox_config`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT für exportierte Tabellen
--

--
-- AUTO_INCREMENT für Tabelle `broadcasts`
--
ALTER TABLE `broadcasts`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT für Tabelle `moderator_notes`
--
ALTER TABLE `moderator_notes`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT für Tabelle `moderator_stats`
--
ALTER TABLE `moderator_stats`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT für Tabelle `wishes`
--
ALTER TABLE `wishes`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT für Tabelle `wishes_archive`
--
ALTER TABLE `wishes_archive`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT für Tabelle `wunschbox_config`
--
ALTER TABLE `wunschbox_config`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- Constraints der exportierten Tabellen
--

--
-- Constraints der Tabelle `broadcasts`
--
ALTER TABLE `broadcasts`
  ADD CONSTRAINT `broadcasts_ibfk_1` FOREIGN KEY (`moderator_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
COMMIT;

