-- Migration 036: Abschreibungstabelle je Wirtschaftsgut CREATE TABLE IF NOT EXISTS asset_depreciation_schedule ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, asset_id INT UNSIGNED NOT NULL, jahr SMALLINT UNSIGNED NOT NULL COMMENT 'Kalenderjahr der Abschreibung', abschreibungsbetrag DECIMAL(12,2) NOT NULL DEFAULT 0.00, restwert DECIMAL(12,2) NOT NULL DEFAULT 0.00, position SMALLINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Reihenfolge (0-basiert)', PRIMARY KEY (id), KEY idx_ads_asset_id (asset_id), UNIQUE KEY uq_ads_asset_jahr (asset_id, jahr) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Lineare Abschreibungstabelle je Wirtschaftsgut';