강릉스마트양식ERD
테이블 (10)
LocationHierarchy
- pk (id) — 기본 키 — NOT NULL
- 이름 (name) — NOT NULL
- 부모 (parent) — fk
네트워크 장비 (NetworkDevice)
- pk (id) — int — 기본 키 — NOT NULL
- 이름 (name) — str — NOT NULL
- 프로토콜 (protocol) — enum — NOT NULL
- ip주소 (ip_address) — str — NOT NULL
- 포트 (port) — int — NOT NULL
- 작동 여부 (is_active) — bool — NOT NULL
센서 설정 (SensorConfig)
- pk (id) — int — 기본 키 — NOT NULL
- 장비위치pk (device_location) — fk — 외래 키 → 장비 위치.pk — NOT NULL
- 이름 (name) — NOT NULL
- 센서 타입 (sensor_type) — enum — NOT NULL
- 위험 최솟값 (danger_threshold_min) — float — NOT NULL
- 위험 최댓값 (danger_threshold_max) — float — NOT NULL
- 주의 최솟값 (warning_threshold_min) — float — NOT NULL
- 주의 최댓값 (warning_threshold_max) — float — NOT NULL
- 센서값주소 (sensor_data_address) — str — NOT NULL
- 네트워크장비pk (network_device) — fk — 외래 키 → 네트워크 장비.pk — NOT NULL
센서 실시간 값 (SensorData)
- pk (id) — int — 기본 키 — NOT NULL
- 센서설정pk (sensor_config) — int — 외래 키 → 센서 설정.pk — NOT NULL
- pk (id2) — pk — 외래 키 → 센서 설정.장비위치pk — NOT NULL
- 값 (value) — float — NOT NULL
- 상태 (status)
알람로그 (AlarmLog)
- pk (Key) — 기본 키 — NOT NULL
- 센서데이터pk (sensor_data) — fk — 외래 키 → 센서 실시간 값.센서설정pk
- 제어상태로그pk (control_status_log) — fk — 외래 키 → 제어 상태 로그.제어설정pk
- 제어실행로그pk (control_execution_log) — fk — 외래 키 → 제어 실행 로그.제어설정pk
- 메시지 (message) — str — NOT NULL
- 해제 메시지 (cleared_message) — str
- 해제 시간 (cleared_at)
유저(django 기본) (User)
- pk (id) — int — 기본 키 — NOT NULL
- 핸드폰번호 (phone) — str
장비 위치 (DeviceLocation)
- pk (id) — pk — 기본 키 — NOT NULL
- 이름 (name) — str — NOT NULL
- 설명 (description) — str
- 네크워크 장비pk (network_device) — fk — 외래 키 → 네트워크 장비.pk — NOT NULL
- hierarchy pk (hierarchy) — fk — 외래 키 → LocationHierarchy.pk
- Field
제어 상태 로그 (ControlStatusLog)
- pk (id) — int — 기본 키 — NOT NULL
- 제어설정pk (control_config) — fk — 외래 키 → 제어 설정.pk — NOT NULL
- 제어 명령어 (control_command) — str — NOT NULL
- 상태 (status) — str — NOT NULL
제어 설정 (ControlConfig)
- pk (id) — pk — 기본 키 — NOT NULL
- 장비위치pk (device_location) — fk — 외래 키 → 장비 위치.pk — NOT NULL
- 이름 (name) — str — NOT NULL
- 제어 종류 (control_type) — enum — NOT NULL
- 제어 명령 (control_command) — str — NOT NULL
- 제어 데이터 주소 (control_data_address) — str — NOT NULL
- 네트워크장비pk (network_device) — fk — 외래 키 → 네트워크 장비.pk — NOT NULL
제어 실행 로그 (ControlExecutionLog)
- pk (id) — 기본 키 — NOT NULL
- 제어설정pk (control_config) — fk — 외래 키 → 제어 설정.장비위치pk — NOT NULL
- 제어 명령어 (control_command) — str — NOT NULL
- 결과 (result_status) — str — NOT NULL
- 설명 (description) — str