+/- table definition

Query

CREATE TABLE cable_maintenance_logs  (
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  cable_route_id INTEGER,
  network_segment_id INTEGER,
  maintenance_type VARCHAR(50) NOT NULL CHECK (maintenance_type IN ('repair', 'replacement', 'inspection', 'upgrade')),
  description TEXT NOT NULL,
  performed_by INTEGER,
  maintenance_date DATE NOT NULL,
  duration_hours DECIMAL(4,2),
  cost DECIMAL(12,2),
  notes TEXT,
  created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
  FOREIGN KEY (cable_route_id) REFERENCES cable_routes(id) ON DELETE CASCADE,
  FOREIGN KEY (network_segment_id) REFERENCES network_segments(id) ON DELETE CASCADE
)
Use Shift + Up/Down to navigate recently-executed queries