Some more changes for Docker
This commit is contained in:
+1
-2
@@ -20,5 +20,4 @@ www/scripts
|
|||||||
www/files/music/*
|
www/files/music/*
|
||||||
!www/files/music/piep.mp3
|
!www/files/music/piep.mp3
|
||||||
www/.well-known
|
www/.well-known
|
||||||
www/intern/kampfrichter/ajax/ajax-neu_dynamic-rangliste.php
|
www/intern/kampfrichter/ajax/ajax-neu_dynamic-rangliste.php
|
||||||
setup/database/*
|
|
||||||
+1
-1
@@ -58,7 +58,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- db_data:/var/lib/mysql
|
- db_data:/var/lib/mysql
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
|
test: ["CMD", "mariadb-admin", "ping", "-h", "127.0.0.1"]
|
||||||
interval: 5s
|
interval: 5s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 5
|
retries: 5
|
||||||
|
|||||||
@@ -0,0 +1,74 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// --- KONFIGURATION ---
|
||||||
|
$sqlFile = __DIR__ . '/wkvs-database-template.sql';
|
||||||
|
$newSqlFile = __DIR__ . '/sql-database.sql';
|
||||||
|
$envFile = __DIR__ . '/../../config/.env.db-tables';
|
||||||
|
$oldPrefix = 'prefix-placeholder_';
|
||||||
|
$hashPlaceholder = 'PW_HASH';
|
||||||
|
|
||||||
|
// --- LOGIK ---
|
||||||
|
|
||||||
|
// 1. Generieren eines neuen, zufälligen Prefixes
|
||||||
|
// Format: 8 zufällige Zeichen + "_" (oder wie Sie es mögen)
|
||||||
|
$newPrefix = bin2hex(random_bytes(6)) . '_';
|
||||||
|
|
||||||
|
echo "=== Prefix Update Prozess ===\n";
|
||||||
|
echo "Alter Prefix: $oldPrefix\n";
|
||||||
|
echo "Neuer Prefix: $newPrefix\n";
|
||||||
|
|
||||||
|
|
||||||
|
if (!file_exists($sqlFile) || !file_exists($envFile)) {
|
||||||
|
die("FEHLER: Die Dateien '$sqlFile' oder '$envFile' wurden nicht gefunden.\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. SQL-Datei verarbeiten (Stream-basiert für Performance)
|
||||||
|
echo "Verarbeite SQL-Datei...\n";
|
||||||
|
$handleIn = fopen($sqlFile, 'r');
|
||||||
|
$handleOut = fopen($newSqlFile, 'w'); // Überschreiben der Originaldatei (oder neue Datei nutzen)
|
||||||
|
|
||||||
|
if (!$handleIn || !$handleOut) {
|
||||||
|
die("FEHLER: Konnte Dateien nicht öffnen.\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
$randPw = bin2hex(random_bytes(12));
|
||||||
|
|
||||||
|
$pwHash = password_hash($randPw, PASSWORD_ARGON2ID);
|
||||||
|
|
||||||
|
$linesProcessed = 0;
|
||||||
|
while (($line = fgets($handleIn)) !== false) {
|
||||||
|
// Ersetze den alten Prefix im SQL-Content
|
||||||
|
$newLine = str_replace($oldPrefix, $newPrefix, $line);
|
||||||
|
$newLine = str_replace($hashPlaceholder, $pwHash, $newLine);
|
||||||
|
fwrite($handleOut, $newLine);
|
||||||
|
$linesProcessed++;
|
||||||
|
}
|
||||||
|
|
||||||
|
fclose($handleIn);
|
||||||
|
fclose($handleOut);
|
||||||
|
echo "✓ SQL-Datei aktualisiert ($linesProcessed Zeilen bearbeitet).\n";
|
||||||
|
echo "\n-\n-\n-\n ---> WK-Leitungs Benutzer hinzugefügt. Benutzername: admin Passwort: $randPw\n-\n-\n";
|
||||||
|
|
||||||
|
// 4. .env-Datei verarbeiten
|
||||||
|
echo "Aktualisiere .env-Datei...\n";
|
||||||
|
$envContent = file_get_contents($envFile);
|
||||||
|
|
||||||
|
// Wir ersetzen die Zeile DB_PREFIX=... durch DB_PREFIX=...
|
||||||
|
// Regex sucht nach "DB_PREFIX=" gefolgt von beliebigen Zeichen bis Zeilenende
|
||||||
|
$pattern = '/^DB_PREFIX=.*/m';
|
||||||
|
$replacement = "DB_PREFIX=$newPrefix";
|
||||||
|
|
||||||
|
$updatedEnv = preg_replace($pattern, $replacement, $envContent);
|
||||||
|
|
||||||
|
if ($updatedEnv === $envContent) {
|
||||||
|
// Falls die Zeile nicht gefunden wurde, hängen wir sie an
|
||||||
|
$updatedEnv .= "\nDB_PREFIX=$newPrefix";
|
||||||
|
echo "⚠️ Hinweis: DB_PREFIX war nicht in der .env, wurde angehängt.\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
file_put_contents($envFile, $updatedEnv);
|
||||||
|
echo "✓ .env-Datei aktualisiert.\n";
|
||||||
|
|
||||||
|
// 5. Abschluss
|
||||||
|
echo "\n Prozess erfolgreich abgeschlossen!\n";
|
||||||
|
echo "Bitte prüfen Sie Ihre Dateien und setzen Sie den neuen Prefix in Ihrer Konfiguration. Dateiname: $newSqlFile\n";
|
||||||
@@ -0,0 +1,203 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WKVS Database User Generator & Manager Script
|
||||||
|
*
|
||||||
|
* Functions:
|
||||||
|
* 1. Reads database configuration from config/.env.db, config/.env.db-wkvs-user, config/.env.db-guest
|
||||||
|
* 2. Connects to MariaDB/MySQL using Root credentials
|
||||||
|
* 3. Auto-creates or updates DB users (Normal User with CRUD & Guest User with Read-only)
|
||||||
|
* 4. Updates the respective .env files so PHP application stays in sync
|
||||||
|
*
|
||||||
|
* Can be run via CLI: php setup/database/generate-users.php
|
||||||
|
* Or included in web endpoints to change user credentials dynamically.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Helper to parse simple key=value .env files without requiring composer packages
|
||||||
|
function parse_env_file_simple(string $filepath): array {
|
||||||
|
$env = [];
|
||||||
|
if (!file_exists($filepath)) {
|
||||||
|
return $env;
|
||||||
|
}
|
||||||
|
$lines = file($filepath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||||
|
foreach ($lines as $line) {
|
||||||
|
$line = trim($line);
|
||||||
|
if (empty($line) || str_starts_with($line, '#')) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$parts = explode('=', $line, 2);
|
||||||
|
if (count($parts) === 2) {
|
||||||
|
$key = trim($parts[0]);
|
||||||
|
$val = trim($parts[1], " \t\n\r\0\x0B\"'");
|
||||||
|
$env[$key] = $val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $env;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Helper to write key=value pairs back to a .env file safely
|
||||||
|
function write_env_file_simple(string $filepath, array $data): bool {
|
||||||
|
$content = "";
|
||||||
|
foreach ($data as $key => $val) {
|
||||||
|
$content .= "{$key}={$val}\n";
|
||||||
|
}
|
||||||
|
return file_put_contents($filepath, $content) !== false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Main logic wrapped in a reusable function
|
||||||
|
function sync_and_create_db_users(
|
||||||
|
?string $overrideUser = null,
|
||||||
|
?string $overrideUserPass = null,
|
||||||
|
?string $overrideGuest = null,
|
||||||
|
?string $overrideGuestPass = null
|
||||||
|
): array {
|
||||||
|
$baseDir = dirname(__DIR__, 2);
|
||||||
|
$configDir = $baseDir . '/config';
|
||||||
|
|
||||||
|
$dbEnvFile = $configDir . '/.env.db';
|
||||||
|
$userEnvFile = $configDir . '/.env.db-wkvs-user';
|
||||||
|
$guestEnvFile = $configDir . '/.env.db-guest';
|
||||||
|
|
||||||
|
// 1. Load Root DB config
|
||||||
|
$dbEnv = parse_env_file_simple($dbEnvFile);
|
||||||
|
$rootPass = $dbEnv['MYSQL_ROOT_PASSWORD'] ?? '';
|
||||||
|
$dbName = $dbEnv['MYSQL_DATABASE'] ?? 'devdb_';
|
||||||
|
|
||||||
|
// Target host for MySQL connection from PHP script
|
||||||
|
// If running inside Docker container or host, determine host
|
||||||
|
$dbHost = getenv('DB_HOST') ?: ($dbEnv['DB_HOST'] ?? 'mariadb');
|
||||||
|
$dbPort = (int)($dbEnv['DB_PORT'] ?? 3306);
|
||||||
|
|
||||||
|
// Fallback connection attempt hosts
|
||||||
|
$hostsToTry = [$dbHost, '127.0.0.1', 'mariadb', 'localhost'];
|
||||||
|
|
||||||
|
$mysqli = null;
|
||||||
|
$connectedHost = null;
|
||||||
|
|
||||||
|
foreach ($hostsToTry as $tryHost) {
|
||||||
|
try {
|
||||||
|
$testConn = @new mysqli($tryHost, 'root', $rootPass, '', $dbPort);
|
||||||
|
if (!$testConn->connect_error) {
|
||||||
|
$mysqli = $testConn;
|
||||||
|
$connectedHost = $tryHost;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch (Throwable $e) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$mysqli) {
|
||||||
|
return [
|
||||||
|
'success' => false,
|
||||||
|
'message' => "Konnte keine Verbindung als 'root' zu MariaDB herstellen. Bitte prüfen Sie MYSQL_ROOT_PASSWORD in config/.env.db."
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. Load existing user env files or generate defaults
|
||||||
|
$userEnv = parse_env_file_simple($userEnvFile);
|
||||||
|
$guestEnv = parse_env_file_simple($guestEnvFile);
|
||||||
|
|
||||||
|
// Prefix helper for usernames if creating new
|
||||||
|
$dbUser = $overrideUser ?: ($userEnv['DB_USER'] ?? 'wkvs_user');
|
||||||
|
$dbPass = $overrideUserPass ?: ($userEnv['DB_PASSWORD'] ?? bin2hex(random_bytes(16)));
|
||||||
|
|
||||||
|
$dbGuestUser = $overrideGuest ?: ($guestEnv['DB_GUEST_USER'] ?? 'wkvs_guest');
|
||||||
|
$dbGuestPass = $overrideGuestPass?: ($guestEnv['DB_GUEST_PASSWORD'] ?? bin2hex(random_bytes(16)));
|
||||||
|
|
||||||
|
$appDbHost = $userEnv['DB_HOST'] ?? 'mariadb';
|
||||||
|
$appDbPort = $userEnv['DB_PORT'] ?? 3306;
|
||||||
|
|
||||||
|
// 3. Create database if it does not exist
|
||||||
|
$mysqli->query("CREATE DATABASE IF NOT EXISTS `$dbName` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci");
|
||||||
|
|
||||||
|
// 4. Create or Update Normal User (SELECT, INSERT, UPDATE, DELETE)
|
||||||
|
// Access is isolated to the Docker network container level via compose.yaml
|
||||||
|
$escapedUser = $mysqli->real_escape_string($dbUser);
|
||||||
|
$escapedPass = $mysqli->real_escape_string($dbPass);
|
||||||
|
$escapedDb = $mysqli->real_escape_string($dbName);
|
||||||
|
|
||||||
|
// Clean up legacy per-host entries if present
|
||||||
|
$mysqli->query("DROP USER IF EXISTS '{$escapedUser}'@'%'");
|
||||||
|
|
||||||
|
|
||||||
|
// Normal User (1 user entry)
|
||||||
|
$mysqli->query("CREATE USER IF NOT EXISTS '{$escapedUser}'@'%' IDENTIFIED BY '{$escapedPass}'");
|
||||||
|
$mysqli->query("ALTER USER '{$escapedUser}'@'%' IDENTIFIED BY '{$escapedPass}'");
|
||||||
|
$mysqli->query("GRANT SELECT, INSERT, UPDATE, DELETE ON `{$escapedDb}`.* TO '{$escapedUser}'@'%'");
|
||||||
|
|
||||||
|
// Guest User (SELECT only)
|
||||||
|
$escapedGuest = $mysqli->real_escape_string($dbGuestUser);
|
||||||
|
$escapedGuestPass = $mysqli->real_escape_string($dbGuestPass);
|
||||||
|
|
||||||
|
// Clean up legacy per-host entries if present
|
||||||
|
foreach (['127.0.0.1', 'localhost', '172.%.%.%', '10.%.%.%', '192.168.%.%.%'] as $oldHost) {
|
||||||
|
$mysqli->query("DROP USER IF EXISTS '{$escapedGuest}'@'{$oldHost}'");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Guest User (1 user entry)
|
||||||
|
$mysqli->query("CREATE USER IF NOT EXISTS '{$escapedGuest}'@'%' IDENTIFIED BY '{$escapedGuestPass}'");
|
||||||
|
$mysqli->query("ALTER USER '{$escapedGuest}'@'%' IDENTIFIED BY '{$escapedGuestPass}'");
|
||||||
|
$mysqli->query("GRANT SELECT ON `{$escapedDb}`.* TO '{$escapedGuest}'@'%'");
|
||||||
|
|
||||||
|
$mysqli->query("FLUSH PRIVILEGES");
|
||||||
|
$mysqli->close();
|
||||||
|
|
||||||
|
// 5. Update .env files
|
||||||
|
$newUserEnvData = [
|
||||||
|
'DB_USER' => $dbUser,
|
||||||
|
'DB_PASSWORD' => $dbPass,
|
||||||
|
'DB_NAME' => $dbName,
|
||||||
|
'DB_HOST' => $appDbHost,
|
||||||
|
'DB_PORT' => $appDbPort,
|
||||||
|
];
|
||||||
|
|
||||||
|
$newGuestEnvData = [
|
||||||
|
'DB_GUEST_USER' => $dbGuestUser,
|
||||||
|
'DB_GUEST_PASSWORD' => $dbGuestPass,
|
||||||
|
'DB_NAME' => $dbName,
|
||||||
|
'DB_HOST' => $appDbHost,
|
||||||
|
'DB_PORT' => $appDbPort,
|
||||||
|
];
|
||||||
|
|
||||||
|
write_env_file_simple($userEnvFile, $newUserEnvData);
|
||||||
|
write_env_file_simple($guestEnvFile, $newGuestEnvData);
|
||||||
|
|
||||||
|
return [
|
||||||
|
'success' => true,
|
||||||
|
'message' => 'Datenbank-Benutzer erfolgreich erstellt/aktualisiert.',
|
||||||
|
'normal_user' => [
|
||||||
|
'username' => $dbUser,
|
||||||
|
'password' => $dbPass,
|
||||||
|
],
|
||||||
|
'guest_user' => [
|
||||||
|
'username' => $dbGuestUser,
|
||||||
|
'password' => $dbGuestPass,
|
||||||
|
]
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// If invoked directly from CLI
|
||||||
|
if (php_sapi_name() === 'cli' && realpath($argv[0] ?? '') === __FILE__) {
|
||||||
|
echo "=== WKVS Database User Auto-Generator ===\n";
|
||||||
|
|
||||||
|
$user = $argv[1] ?? null;
|
||||||
|
$userPass = $argv[2] ?? null;
|
||||||
|
$guest = $argv[3] ?? null;
|
||||||
|
$guestPass = $argv[4] ?? null;
|
||||||
|
|
||||||
|
$result = sync_and_create_db_users($user, $userPass, $guest, $guestPass);
|
||||||
|
|
||||||
|
if ($result['success']) {
|
||||||
|
echo "✓ " . $result['message'] . "\n\n";
|
||||||
|
echo "Normal User (SELECT, INSERT, UPDATE, DELETE):\n";
|
||||||
|
echo " Benutzername: " . $result['normal_user']['username'] . "\n";
|
||||||
|
echo " Passwort: " . $result['normal_user']['password'] . "\n\n";
|
||||||
|
echo "Guest User (SELECT only):\n";
|
||||||
|
echo " Benutzername: " . $result['guest_user']['username'] . "\n";
|
||||||
|
echo " Passwort: " . $result['guest_user']['password'] . "\n";
|
||||||
|
} else {
|
||||||
|
echo "❌ Fehler: " . $result['message'] . "\n";
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Master Database Setup & Initialization Script
|
||||||
|
* Runs user generation and SQL schema import automatically on Docker Compose initialization.
|
||||||
|
*/
|
||||||
|
|
||||||
|
echo "========================================\n";
|
||||||
|
echo " WKVS Database Automated Initializer \n";
|
||||||
|
echo "========================================\n\n";
|
||||||
|
|
||||||
|
$setupDir = __DIR__;
|
||||||
|
$baseDir = dirname(__DIR__, 2);
|
||||||
|
|
||||||
|
// 1. Run User Generation & Grant setup
|
||||||
|
echo "[1/3] Erstelle/Synchronisiere Datenbank-Benutzer...\n";
|
||||||
|
require_once $setupDir . '/generate-users.php';
|
||||||
|
|
||||||
|
$userResult = sync_and_create_db_users();
|
||||||
|
|
||||||
|
if (!$userResult['success']) {
|
||||||
|
echo "❌ Fehler bei Benutzererstellung: " . $userResult['message'] . "\n";
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "✓ " . $userResult['message'] . "\n\n";
|
||||||
|
|
||||||
|
// 2. Generate SQL structure file with table prefix
|
||||||
|
echo "[2/3] Generiere SQL-Struktur & Tabellen-Prefix...\n";
|
||||||
|
require $setupDir . '/generate-sql.php';
|
||||||
|
|
||||||
|
echo "\n[3/3] Importiere Tabellen-Struktur in die Datenbank...\n";
|
||||||
|
|
||||||
|
$generatedSqlFile = $setupDir . '/sql-database.sql';
|
||||||
|
|
||||||
|
if (!file_exists($generatedSqlFile)) {
|
||||||
|
echo "❌ Fehler: '$generatedSqlFile' wurde nicht gefunden.\n";
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Connect to MariaDB to import SQL schema
|
||||||
|
$dbEnvFile = $baseDir . '/config/.env.db';
|
||||||
|
$dbEnv = parse_env_file_simple($dbEnvFile);
|
||||||
|
|
||||||
|
$rootPass = $dbEnv['MYSQL_ROOT_PASSWORD'] ?? '';
|
||||||
|
$dbName = $dbEnv['MYSQL_DATABASE'] ?? 'devdb_';
|
||||||
|
$dbHost = getenv('DB_HOST') ?: ($dbEnv['DB_HOST'] ?? 'mariadb');
|
||||||
|
$dbPort = (int)($dbEnv['DB_PORT'] ?? 3306);
|
||||||
|
|
||||||
|
$mysqli = null;
|
||||||
|
foreach ([$dbHost, 'mariadb', '127.0.0.1', 'localhost'] as $tryHost) {
|
||||||
|
try {
|
||||||
|
$conn = @new mysqli($tryHost, 'root', $rootPass, $dbName, $dbPort);
|
||||||
|
if (!$conn->connect_error) {
|
||||||
|
$mysqli = $conn;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch (Throwable $e) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$mysqli) {
|
||||||
|
echo "❌ Fehler: Konnte keine Verbindung als 'root' zu MariaDB herstellen.\n";
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
$sqlContent = file_get_contents($generatedSqlFile);
|
||||||
|
|
||||||
|
if ($mysqli->multi_query($sqlContent)) {
|
||||||
|
do {
|
||||||
|
if ($res = $mysqli->store_result()) {
|
||||||
|
$res->free();
|
||||||
|
}
|
||||||
|
} while ($mysqli->more_results() && $mysqli->next_result());
|
||||||
|
|
||||||
|
if ($mysqli->errno) {
|
||||||
|
echo "❌ SQL Import-Fehler: " . $mysqli->error . "\n";
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
echo "✓ Datenbank-Struktur erfolgreich importiert!\n\n";
|
||||||
|
} else {
|
||||||
|
echo "❌ SQL Import-Fehler: " . $mysqli->error . "\n";
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
$mysqli->close();
|
||||||
|
|
||||||
|
echo "========================================\n";
|
||||||
|
echo "✅ Datenbank-Initialisierung abgeschlossen!\n";
|
||||||
|
echo "========================================\n";
|
||||||
@@ -0,0 +1,587 @@
|
|||||||
|
|
||||||
|
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
||||||
|
START TRANSACTION;
|
||||||
|
SET time_zone = "+00:00";
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Tabellenstruktur für Tabelle `prefix-placeholder_audiofiles`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `prefix-placeholder_audiofiles` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`file_name` varchar(1024) NOT NULL,
|
||||||
|
`file_path` varchar(1024) NOT NULL,
|
||||||
|
`edited_by` int(11) DEFAULT NULL,
|
||||||
|
`timestamp` timestamp NOT NULL DEFAULT current_timestamp()
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Tabellenstruktur für Tabelle `prefix-placeholder_disziplinen`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `prefix-placeholder_disziplinen` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`name` varchar(1024) DEFAULT NULL,
|
||||||
|
`start_index` int(11) DEFAULT NULL,
|
||||||
|
`color_kampfrichter` char(7) NOT NULL DEFAULT '#424242',
|
||||||
|
`audiofile` tinyint(1) DEFAULT NULL,
|
||||||
|
`audiofile_max_duration` int(11) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||||
|
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Tabellenstruktur für Tabelle `prefix-placeholder_einmal_links`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `prefix-placeholder_einmal_links` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`url` varchar(1000) DEFAULT NULL,
|
||||||
|
`user_id` int(11) NOT NULL DEFAULT 0,
|
||||||
|
`type` enum('login','pwreset','create_profile','') NOT NULL,
|
||||||
|
`timestamp` timestamp NOT NULL DEFAULT current_timestamp(),
|
||||||
|
`expires_at` timestamp NULL DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Trigger `prefix-placeholder_einmal_links`
|
||||||
|
--
|
||||||
|
DELIMITER $$
|
||||||
|
CREATE TRIGGER `before_insert_login_tokens` BEFORE INSERT ON `prefix-placeholder_einmal_links` FOR EACH ROW BEGIN
|
||||||
|
IF NEW.url IS NULL THEN
|
||||||
|
SET NEW.url = HEX(RANDOM_BYTES(32));
|
||||||
|
END IF;
|
||||||
|
END
|
||||||
|
$$
|
||||||
|
DELIMITER ;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Tabellenstruktur für Tabelle `prefix-placeholder_gruppen`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `prefix-placeholder_gruppen` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`name` varchar(100) NOT NULL DEFAULT 'KEIN NAME',
|
||||||
|
`order_index` int(11) NOT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Tabellenstruktur für Tabelle `prefix-placeholder_gruppen_zeiten`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `prefix-placeholder_gruppen_zeiten` (
|
||||||
|
`zeitplan_id` int(11) NOT NULL,
|
||||||
|
`start_time` time NOT NULL,
|
||||||
|
`end_time` time DEFAULT NULL,
|
||||||
|
`abt_id` int(11) NOT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Tabellenstruktur für Tabelle `prefix-placeholder_intern_benutzende`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `prefix-placeholder_intern_benutzende` (
|
||||||
|
`id` bigint(20) UNSIGNED NOT NULL,
|
||||||
|
`username` varchar(191) DEFAULT NULL,
|
||||||
|
`name_person` varchar(255) DEFAULT NULL,
|
||||||
|
`password_hash` varchar(255) DEFAULT NULL,
|
||||||
|
`password_cipher` text DEFAULT NULL,
|
||||||
|
`created_at` datetime NOT NULL DEFAULT current_timestamp(),
|
||||||
|
`updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
|
||||||
|
`edited_by` varchar(20) NOT NULL DEFAULT '0',
|
||||||
|
`freigabe` varchar(500) NOT NULL DEFAULT 'keine',
|
||||||
|
`login_active` tinyint(1) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
INSERT INTO `prefix-placeholder_intern_benutzende` (`id`, `username`, `password_hash`, `password_cipher`, `freigabe`, `login_active`)
|
||||||
|
VALUES ('1', 'admin', 'PW_HASH', 'not_set', '{"types":["wk_leitung","trainer","kampfrichter"],"freigabenTrainer":["admin"],"freigabenKampfrichter":["A"]}', '1');
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Tabellenstruktur für Tabelle `prefix-placeholder_kategorien`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `prefix-placeholder_kategorien` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`programm` text NOT NULL,
|
||||||
|
`order_index` int(11) DEFAULT NULL,
|
||||||
|
`preis` decimal(10,2) DEFAULT 0.00,
|
||||||
|
`aktiv` tinyint(1) NOT NULL DEFAULT 0
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Tabellenstruktur für Tabelle `prefix-placeholder_tabellen_konfiguration`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `prefix-placeholder_tabellen_konfiguration` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`type_slug` varchar(128) NOT NULL,
|
||||||
|
`json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`json`)),
|
||||||
|
`all_noten_json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`all_noten_json`)),
|
||||||
|
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
|
||||||
|
`updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
|
||||||
|
`created_by` int(11) DEFAULT NULL,
|
||||||
|
`updated_by` int(11) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Tabellenstruktur für Tabelle `prefix-placeholder_teilnehmende`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `prefix-placeholder_teilnehmende` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`wk_id` int(11) DEFAULT NULL,
|
||||||
|
`name` text NOT NULL,
|
||||||
|
`vorname` text NOT NULL,
|
||||||
|
`geburtsdatum` date NOT NULL,
|
||||||
|
`programm` text NOT NULL,
|
||||||
|
`verein` text NOT NULL,
|
||||||
|
`bezahlt` int(11) NOT NULL DEFAULT 1,
|
||||||
|
`bezahltoverride` int(11) NOT NULL DEFAULT 0,
|
||||||
|
`betrag_bezahlt` decimal(12,2) NOT NULL DEFAULT 0.00
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Tabellenstruktur für Tabelle `prefix-placeholder_teilnehmende_audiofiles`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `prefix-placeholder_teilnehmende_audiofiles` (
|
||||||
|
`person_id` int(7) NOT NULL,
|
||||||
|
`geraet_id` int(7) NOT NULL,
|
||||||
|
`audiofile_id` int(7) NOT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Tabellenstruktur für Tabelle `prefix-placeholder_teilnehmende_gruppen`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `prefix-placeholder_teilnehmende_gruppen` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`turnerin_id` int(11) NOT NULL,
|
||||||
|
`abteilung_id` int(11) NOT NULL,
|
||||||
|
`geraet_id` int(11) NOT NULL,
|
||||||
|
`turnerin_index` int(11) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Tabellenstruktur für Tabelle `prefix-placeholder_variables`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `prefix-placeholder_variables` (
|
||||||
|
`name` varchar(255) NOT NULL DEFAULT 'NaN',
|
||||||
|
`value` varchar(255) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Tabellenstruktur für Tabelle `prefix-placeholder_verbuchte_startgebueren`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `prefix-placeholder_verbuchte_startgebueren` (
|
||||||
|
`order_id` int(11) NOT NULL,
|
||||||
|
`order_type` varchar(100) DEFAULT NULL,
|
||||||
|
`preis` float DEFAULT NULL,
|
||||||
|
`user_id` int(11) NOT NULL,
|
||||||
|
`item_ids` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`item_ids`)),
|
||||||
|
`used_verein_konten` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '\'{}\'',
|
||||||
|
`order_status` int(11) NOT NULL DEFAULT 0,
|
||||||
|
`timestamp` timestamp NOT NULL DEFAULT current_timestamp(),
|
||||||
|
`edited_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Tabellenstruktur für Tabelle `prefix-placeholder_verbuchte_startgebueren_log`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `prefix-placeholder_verbuchte_startgebueren_log` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`order_id` int(11) NOT NULL,
|
||||||
|
`old_order_status` int(11) NOT NULL,
|
||||||
|
`new_order_status` int(11) NOT NULL,
|
||||||
|
`edited_by` int(11) NOT NULL,
|
||||||
|
`edited_at` timestamp NOT NULL DEFAULT current_timestamp()
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Tabellenstruktur für Tabelle `prefix-placeholder_vereine`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `prefix-placeholder_vereine` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`verein` text NOT NULL,
|
||||||
|
`email` varchar(100) NOT NULL DEFAULT 'forms@testseite-fh.ch',
|
||||||
|
`konto` decimal(12,2) NOT NULL DEFAULT 0.00
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Tabellenstruktur für Tabelle `prefix-placeholder_warenkorb_startgebueren`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `prefix-placeholder_warenkorb_startgebueren` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`user_id` bigint(20) UNSIGNED NOT NULL,
|
||||||
|
`item_id` int(11) NOT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Tabellenstruktur für Tabelle `prefix-placeholder_wertungen`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `prefix-placeholder_wertungen` (
|
||||||
|
`person_id` int(11) NOT NULL,
|
||||||
|
`note_bezeichnung_id` int(11) NOT NULL,
|
||||||
|
`geraet_id` int(11) NOT NULL,
|
||||||
|
`wk_id` int(11) NOT NULL,
|
||||||
|
`run_number` tinyint(3) NOT NULL DEFAULT 1,
|
||||||
|
`value` float DEFAULT NULL,
|
||||||
|
`is_public` tinyint(1) DEFAULT NULL,
|
||||||
|
`public_value` float DEFAULT NULL,
|
||||||
|
`timestamp` timestamp NOT NULL DEFAULT current_timestamp()
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Tabellenstruktur für Tabelle `prefix-placeholder_wertungen_log`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `prefix-placeholder_wertungen_log` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`person_id` int(11) NOT NULL,
|
||||||
|
`note_bezeichnung_id` int(11) NOT NULL,
|
||||||
|
`geraet_id` int(11) NOT NULL,
|
||||||
|
`wk_id` int(11) NOT NULL,
|
||||||
|
`run_number` tinyint(3) NOT NULL DEFAULT 1,
|
||||||
|
`old_value` float DEFAULT NULL,
|
||||||
|
`new_value` float DEFAULT NULL,
|
||||||
|
`edited_by` int(11) NOT NULL,
|
||||||
|
`timestamp` timestamp NOT NULL DEFAULT current_timestamp()
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Tabellenstruktur für Tabelle `prefix-placeholder_wertungstypen`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `prefix-placeholder_wertungstypen` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`name` varchar(255) NOT NULL,
|
||||||
|
`default_value` float DEFAULT NULL,
|
||||||
|
`type` enum('input','berechnung') NOT NULL DEFAULT 'input',
|
||||||
|
`berechnung` varchar(255) DEFAULT NULL,
|
||||||
|
`berechnung_json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`berechnung_json`)),
|
||||||
|
`max_value` float DEFAULT NULL,
|
||||||
|
`min_value` float DEFAULT NULL,
|
||||||
|
`pro_geraet` tinyint(1) NOT NULL DEFAULT 1,
|
||||||
|
`anzahl_laeufe_json` text DEFAULT NULL,
|
||||||
|
`geraete_json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT '[]',
|
||||||
|
`zeige_auf_rangliste` float DEFAULT NULL,
|
||||||
|
`groesse_auf_rangliste` int(11) NOT NULL DEFAULT 0,
|
||||||
|
`nullstellen` int(11) NOT NULL DEFAULT 2,
|
||||||
|
`display_string` varchar(63) NOT NULL DEFAULT '${note}'
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Tabellenstruktur für Tabelle `prefix-placeholder_wettkaempfe`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `prefix-placeholder_wettkaempfe` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`name` varchar(256) NOT NULL,
|
||||||
|
`slug` varchar(64) NOT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||||
|
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Tabellenstruktur für Tabelle `prefix-placeholder_zeitplan_types`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `prefix-placeholder_zeitplan_types` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`name` varchar(2048) NOT NULL,
|
||||||
|
`has_endtime` tinyint(1) DEFAULT NULL,
|
||||||
|
`display_index` int(11) NOT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Indizes der exportierten Tabellen
|
||||||
|
--
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Indizes für die Tabelle `prefix-placeholder_audiofiles`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_audiofiles`
|
||||||
|
ADD PRIMARY KEY (`id`);
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Indizes für die Tabelle `prefix-placeholder_disziplinen`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_disziplinen`
|
||||||
|
ADD PRIMARY KEY (`id`);
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Indizes für die Tabelle `prefix-placeholder_einmal_links`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_einmal_links`
|
||||||
|
ADD PRIMARY KEY (`id`),
|
||||||
|
ADD UNIQUE KEY `url` (`url`);
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Indizes für die Tabelle `prefix-placeholder_gruppen`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_gruppen`
|
||||||
|
ADD PRIMARY KEY (`id`);
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Indizes für die Tabelle `prefix-placeholder_gruppen_zeiten`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_gruppen_zeiten`
|
||||||
|
ADD UNIQUE KEY `unique_index` (`zeitplan_id`,`abt_id`);
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Indizes für die Tabelle `prefix-placeholder_intern_benutzende`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_intern_benutzende`
|
||||||
|
ADD PRIMARY KEY (`id`),
|
||||||
|
ADD UNIQUE KEY `username_page_unique` (`username`,`password_hash`) USING BTREE,
|
||||||
|
ADD KEY `indexFreigabe` (`freigabe`);
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Indizes für die Tabelle `prefix-placeholder_kategorien`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_kategorien`
|
||||||
|
ADD PRIMARY KEY (`id`);
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Indizes für die Tabelle `prefix-placeholder_tabellen_konfiguration`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_tabellen_konfiguration`
|
||||||
|
ADD PRIMARY KEY (`id`),
|
||||||
|
ADD UNIQUE KEY `unique_slug` (`type_slug`);
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Indizes für die Tabelle `prefix-placeholder_teilnehmende`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_teilnehmende`
|
||||||
|
ADD PRIMARY KEY (`id`),
|
||||||
|
ADD KEY `wk_index` (`wk_id`);
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Indizes für die Tabelle `prefix-placeholder_teilnehmende_audiofiles`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_teilnehmende_audiofiles`
|
||||||
|
ADD UNIQUE KEY `unique_combo` (`person_id`,`geraet_id`);
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Indizes für die Tabelle `prefix-placeholder_teilnehmende_gruppen`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_teilnehmende_gruppen`
|
||||||
|
ADD PRIMARY KEY (`id`),
|
||||||
|
ADD UNIQUE KEY `unique_turnerin` (`turnerin_id`);
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Indizes für die Tabelle `prefix-placeholder_variables`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_variables`
|
||||||
|
ADD UNIQUE KEY `uniqueIndex` (`name`);
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Indizes für die Tabelle `prefix-placeholder_verbuchte_startgebueren`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_verbuchte_startgebueren`
|
||||||
|
ADD PRIMARY KEY (`order_id`);
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Indizes für die Tabelle `prefix-placeholder_verbuchte_startgebueren_log`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_verbuchte_startgebueren_log`
|
||||||
|
ADD PRIMARY KEY (`id`);
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Indizes für die Tabelle `prefix-placeholder_vereine`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_vereine`
|
||||||
|
ADD PRIMARY KEY (`id`),
|
||||||
|
ADD UNIQUE KEY `indexturnerinnen` (`id`,`verein`(31));
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Indizes für die Tabelle `prefix-placeholder_warenkorb_startgebueren`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_warenkorb_startgebueren`
|
||||||
|
ADD PRIMARY KEY (`id`),
|
||||||
|
ADD KEY `prefix-placeholder_basket_items_ibfk_1` (`user_id`),
|
||||||
|
ADD KEY `prefix-placeholder_basket_items_ibfk_2` (`item_id`);
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Indizes für die Tabelle `prefix-placeholder_wertungen`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_wertungen`
|
||||||
|
ADD UNIQUE KEY `uniquePersonNoteJahrGereat` (`person_id`,`note_bezeichnung_id`,`wk_id`,`geraet_id`,`run_number`) USING BTREE;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Indizes für die Tabelle `prefix-placeholder_wertungen_log`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_wertungen_log`
|
||||||
|
ADD PRIMARY KEY (`id`);
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Indizes für die Tabelle `prefix-placeholder_wertungstypen`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_wertungstypen`
|
||||||
|
ADD PRIMARY KEY (`id`),
|
||||||
|
ADD UNIQUE KEY `uniqueName` (`name`) USING BTREE,
|
||||||
|
ADD KEY `indexMaxValue` (`max_value`),
|
||||||
|
ADD KEY `indexMinValue` (`min_value`),
|
||||||
|
ADD KEY `indexBerechnungJson` (`berechnung_json`(768)),
|
||||||
|
ADD KEY `indexDefaultValue` (`default_value`),
|
||||||
|
ADD KEY `indexType` (`type`),
|
||||||
|
ADD KEY `indexNullstellen` (`nullstellen`) USING BTREE;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Indizes für die Tabelle `prefix-placeholder_wettkaempfe`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_wettkaempfe`
|
||||||
|
ADD PRIMARY KEY (`id`),
|
||||||
|
ADD UNIQUE KEY `slug` (`slug`);
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Indizes für die Tabelle `prefix-placeholder_zeitplan_types`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_zeitplan_types`
|
||||||
|
ADD PRIMARY KEY (`id`);
|
||||||
|
|
||||||
|
--
|
||||||
|
-- AUTO_INCREMENT für exportierte Tabellen
|
||||||
|
--
|
||||||
|
|
||||||
|
--
|
||||||
|
-- AUTO_INCREMENT für Tabelle `prefix-placeholder_audiofiles`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_audiofiles`
|
||||||
|
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- AUTO_INCREMENT für Tabelle `prefix-placeholder_disziplinen`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_disziplinen`
|
||||||
|
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- AUTO_INCREMENT für Tabelle `prefix-placeholder_einmal_links`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_einmal_links`
|
||||||
|
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=118;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- AUTO_INCREMENT für Tabelle `prefix-placeholder_gruppen`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_gruppen`
|
||||||
|
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=165;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- AUTO_INCREMENT für Tabelle `prefix-placeholder_intern_benutzende`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_intern_benutzende`
|
||||||
|
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=40;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- AUTO_INCREMENT für Tabelle `prefix-placeholder_kategorien`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_kategorien`
|
||||||
|
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- AUTO_INCREMENT für Tabelle `prefix-placeholder_tabellen_konfiguration`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_tabellen_konfiguration`
|
||||||
|
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=106;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- AUTO_INCREMENT für Tabelle `prefix-placeholder_teilnehmende`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_teilnehmende`
|
||||||
|
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=295;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- AUTO_INCREMENT für Tabelle `prefix-placeholder_teilnehmende_gruppen`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_teilnehmende_gruppen`
|
||||||
|
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1030;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- AUTO_INCREMENT für Tabelle `prefix-placeholder_verbuchte_startgebueren_log`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_verbuchte_startgebueren_log`
|
||||||
|
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=86;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- AUTO_INCREMENT für Tabelle `prefix-placeholder_vereine`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_vereine`
|
||||||
|
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- AUTO_INCREMENT für Tabelle `prefix-placeholder_warenkorb_startgebueren`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_warenkorb_startgebueren`
|
||||||
|
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1241;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- AUTO_INCREMENT für Tabelle `prefix-placeholder_wertungen_log`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_wertungen_log`
|
||||||
|
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=883;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- AUTO_INCREMENT für Tabelle `prefix-placeholder_wettkaempfe`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_wettkaempfe`
|
||||||
|
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- AUTO_INCREMENT für Tabelle `prefix-placeholder_zeitplan_types`
|
||||||
|
--
|
||||||
|
ALTER TABLE `prefix-placeholder_zeitplan_types`
|
||||||
|
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
|
||||||
|
COMMIT;
|
||||||
|
|
||||||
|
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||||
|
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||||
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
Reference in New Issue
Block a user