-- https://www.phpmyadmin.net/
--
-- Erstellungszeit: 22. Nov 2025 um 12:04
-- Server-Version: 8.0.42-33
-- PHP-Version: 7.2.34

START TRANSACTION;



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

CREATE TABLE `broadcasts` (
  `id` int NOT NULL AUTO_INCREMENT,
  `moderator_id` int DEFAULT NULL,
  `broadcast_date` date NOT NULL,
  `start_time` time NOT NULL,
  `end_time` time DEFAULT NULL,
  `title` varchar(255) CHARACTER SET utf8mb4 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',
  PRIMARY KEY (`id`),
  KEY `moderator_id` (`moderator_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

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

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

--
-- Daten für Tabelle `moderator_notes`
--

INSERT INTO `moderator_notes` (`id`, `user_id`, `note`, `created_at`) VALUES
(1, 1, 'Ihr könnt jetzt während der Sendung die Wunschbox ausschalten. Bitte nach der Sendung die Wunschbox wieder starten wenn ihr sie gestoppt habt!!! ACHTUNG wenn ihr eine Sendung eintragt und diese um 0:00 endet, tragt sendungs ende 23:59 ein...das wichtig sonst wird sie nicht angezeigt!!!      Ihr Lieben, ihr könnt jetzt das Blasenspiel selber starten und Stoppen. Den Highscore könnt ihr nach jedem spiel wieder löschen wenn ihr wollt. Viel spass.', '2025-07-26 12:22:59');

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

--
-- Tabellenstruktur für Tabelle `moderator_year_stats`
--

CREATE TABLE `moderator_year_stats` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `year` int NOT NULL,
  `total_broadcasts` int NOT NULL DEFAULT '0',
  `total_broadcast_hours` decimal(10,2) NOT NULL DEFAULT '0.00',
  `total_wishes_processed` int NOT NULL DEFAULT '0',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_user_year` (`user_id`,`year`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Tabellenstruktur für Tabelle `moderator_categories`
--

CREATE TABLE `moderator_categories` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `sort_order` int DEFAULT 0,
  `created_at` timestamp DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Daten für Tabelle `moderator_categories`
--

INSERT INTO `moderator_categories` (`id`, `name`, `sort_order`) VALUES
(1, 'Inhaber', 1),
(2, 'Moderator', 2),
(3, 'Gasthörer', 3);

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

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

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

--
-- Daten für Tabelle `settings`
--

INSERT INTO `settings` (`name`, `value`) VALUES
('wunschbox_disabled', '0');

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

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

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

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

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

CREATE TABLE `wishes_archive` (
  `id` int NOT NULL AUTO_INCREMENT,
  `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) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `greeting` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

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

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

--
-- Daten für Tabelle `wunschbox_config`
--

INSERT INTO `wunschbox_config` (`id`, `time_limit_enabled`, `time_limit_minutes`) VALUES
(1, 0, 20);

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

