- EquipmentPage: add COM-port connection type with port field (COM1, /dev/ttyUSB0) - api.ts: add comPort field to WorkstationDevice type - workstations route: pass com_port to INSERT/PATCH - migration 042: extend connection check constraint to include 'com', add com_port column - agent index.html: highlight first cell on load, reset input on unpair Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
14 lines
600 B
SQL
14 lines
600 B
SQL
-- Добавляем поддержку COM-порта для устройств рабочего места
|
|
|
|
-- Расширяем CHECK constraint для connection (добавляем 'com')
|
|
ALTER TABLE workstation_devices
|
|
DROP CONSTRAINT IF EXISTS workstation_devices_connection_check;
|
|
|
|
ALTER TABLE workstation_devices
|
|
ADD CONSTRAINT workstation_devices_connection_check
|
|
CHECK (connection IN ('usb', 'network', 'com'));
|
|
|
|
-- Добавляем поле com_port (например: COM1, COM3, /dev/ttyUSB0)
|
|
ALTER TABLE workstation_devices
|
|
ADD COLUMN IF NOT EXISTS com_port VARCHAR(50);
|