Files
simple-aircraft-manager-rails/db/migrate/20261107240000_add_component_times_to_logbook_entries.rb
rickyandClaude Opus 5.5 a51f78ebf3 Logbook entries link a component and its times; boxed page printouts
- An entry can link a component (engine, propeller…) and records its total
  time and time since overhaul at the entry; picking the engine or prop log
  selects that component and fills its current times (editable). Squawk
  fixes carry the squawk's component
- Components have an overhaul type (major, factory overhaul, factory new),
  shown as SMOH / SFOH / SNEW
- Printouts: engine and propeller entries add the serial number, total
  time and SMOH/SFOH (blanks when no component is linked); airframe total
  time is labelled as such; full-page layouts draw a box around each entry
- Archives carry the entry's component and times (the original format's
  components / component_hours), no longer dropped on import

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 11:19:44 -05:00

11 lines
577 B
Ruby

# Engine and propeller log entries record which component they're for and
# its times at the entry (total, and since overhaul), as printed in the log.
class AddComponentTimesToLogbookEntries < ActiveRecord::Migration[8.1]
def change
add_reference :logbook_entries, :component, foreign_key: { on_delete: :nullify }
add_column :logbook_entries, :component_hours_at_entry, :decimal, precision: 8, scale: 1
add_column :logbook_entries, :component_since_overhaul_at_entry, :decimal, precision: 8, scale: 1
add_column :components, :overhaul_kind, :string
end
end