kundenkarte/sql/dolibarr_allversions.sql
data 71272fa425 fix(schematic): Terminal-Farbpropagierung, Auto-Naming, PWA-Abgänge
- buildTerminalPhaseMap: Schritt 1b - Leitungen mit expliziter Farbe als
  Startpunkte (nur Gerät→Gerät, keine Abgänge)
- buildTerminalPhaseMap: Block-Durchreichung (Top↔Bottom) entfernt
- buildTerminalPhaseMap: Junction-Verbindungen (Terminal→Leitung)
  bidirektional verarbeitet via _connectionById Index
- PWA: Abgangs-Rendering mit Index-Fallback wenn source_terminal_id fehlt
- PWA: Abgangs-Labels max-height 130px, min-height 30px
- Auto-Naming: EquipmentCarrier create/update → 'R' + count
- Auto-Naming: EquipmentPanel update → 'Feld ' + count
- pwa_api.php: Hardcoded Fallbacks 'Feld'/'Hutschiene' entfernt
- pwa.js: Hutschiene Auto-Naming dynamisch aus Panel-Carrier-Anzahl
- kundenkarte.js: Carrier-Dialog Placeholder 'z.B. R1 (automatisch)'
- SW Cache auf v12.5 hochgezählt

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 09:57:58 +01:00

52 lines
2.4 KiB
SQL
Executable file

--
-- Script run when an upgrade of Dolibarr is done. Whatever is the Dolibarr version.
--
-- Add path_data column for manually drawn connection paths
ALTER TABLE llx_kundenkarte_equipment_connection ADD COLUMN IF NOT EXISTS path_data TEXT AFTER position_y;
-- Add icon_file column for custom SVG/PNG schematic symbols
ALTER TABLE llx_kundenkarte_equipment_type ADD COLUMN IF NOT EXISTS icon_file VARCHAR(255) AFTER picto;
-- Add terminals_config if not exists
ALTER TABLE llx_kundenkarte_equipment_type ADD COLUMN IF NOT EXISTS terminals_config TEXT AFTER fk_product;
-- Add flow_direction and terminal_position for equipment types
ALTER TABLE llx_kundenkarte_equipment_type ADD COLUMN IF NOT EXISTS flow_direction VARCHAR(16) DEFAULT NULL AFTER terminals_config;
ALTER TABLE llx_kundenkarte_equipment_type ADD COLUMN IF NOT EXISTS terminal_position VARCHAR(16) DEFAULT 'both' AFTER flow_direction;
-- Add block_image for SchematicEditor display
ALTER TABLE llx_kundenkarte_equipment_type ADD COLUMN IF NOT EXISTS block_image VARCHAR(255) AFTER icon_file;
-- Add busbar type reference to connections
ALTER TABLE llx_kundenkarte_equipment_connection ADD COLUMN IF NOT EXISTS fk_busbar_type INTEGER DEFAULT NULL AFTER is_rail;
-- Create busbar_type table if not exists
CREATE TABLE IF NOT EXISTS llx_kundenkarte_busbar_type
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 0 NOT NULL,
ref varchar(64) NOT NULL,
label varchar(255) NOT NULL,
label_short varchar(32),
description text,
fk_system integer NOT NULL,
phases varchar(20) NOT NULL,
num_lines integer DEFAULT 1 NOT NULL,
color varchar(64),
default_color varchar(8),
line_height integer DEFAULT 3,
line_spacing integer DEFAULT 4,
position_default varchar(16) DEFAULT 'below',
fk_product integer DEFAULT NULL,
picto varchar(64),
icon_file varchar(255),
is_system tinyint DEFAULT 0 NOT NULL,
position integer DEFAULT 0,
active tinyint DEFAULT 1 NOT NULL,
date_creation datetime,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer,
fk_user_modif integer,
import_key varchar(14)
) ENGINE=innodb;