## Legacy schema (inferred)

Source: headers in `old-database/Office/*.csv` (and subfolders) cross-checked against legacy `.SC` scripts.

Notes
- Types are inferred from names/usage; adjust during migration as needed.
- Date fields are typically legacy date types (store as DATE). Money/amounts as DECIMAL(12,2).

### ROLODEX
- Id (TEXT, pk)
- Prefix (TEXT)
- First (TEXT)
- Middle (TEXT)
- Last (TEXT)
- Suffix (TEXT)
- Title (TEXT)
- A1 (TEXT)
- A2 (TEXT)
- A3 (TEXT)
- City (TEXT)
- Abrev (TEXT)
- St (TEXT)
- Zip (TEXT)
- Email (TEXT)
- DOB (DATE)
- SS# (TEXT)
- Legal_Status (TEXT)
- Group (TEXT)
- Memo (TEXT)

### PHONE (by Id)
- Id (TEXT, fk → Rolodex.Id)
- Phone (TEXT)
- Location (TEXT)

### FILES (file cabinet)
- File_No (TEXT, pk)
- Id (TEXT, fk → Rolodex.Id)
- File_Type (TEXT, fk → FileType.File_Type)
- Regarding (TEXT)
- Opened (DATE)
- Closed (DATE, nullable)
- Empl_Num (TEXT, fk → Employee.Empl_Num)
- Rate_Per_Hour (DECIMAL)
- Status (TEXT, fk → FileStat.Status)
- Footer_Code (TEXT, fk → Footers.F_Code)
- Opposing (TEXT, fk → Rolodex.Id)
- Hours (DECIMAL)
- Hours_P (DECIMAL)
- Trust_Bal (DECIMAL)
- Trust_Bal_P (DECIMAL)
- Hourly_Fees (DECIMAL)
- Hourly_Fees_P (DECIMAL)
- Flat_Fees (DECIMAL)
- Flat_Fees_P (DECIMAL)
- Disbursements (DECIMAL)
- Disbursements_P (DECIMAL)
- Credit_Bal (DECIMAL)
- Credit_Bal_P (DECIMAL)
- Total_Charges (DECIMAL)
- Total_Charges_P (DECIMAL)
- Amount_Owing (DECIMAL)
- Amount_Owing_P (DECIMAL)
- Transferable (DECIMAL)
- Memo (TEXT)

### FILES_R (relationships)
- File_No (TEXT, fk → Files.File_No)
- Relationship (TEXT)
- Rolodex_Id (TEXT, fk → Rolodex.Id)

### FILES_V (variables)
- File_No (TEXT, fk → Files.File_No)
- Identifier (TEXT)
- Response (TEXT)

### LEDGER
- File_No (TEXT, fk → Files.File_No)
- Date (DATE)
- Item_No (INTEGER, part of pk per scripts use)
- Empl_Num (TEXT, fk → Employee.Empl_Num)
- T_Code (TEXT, fk → TrnsLkup.T_Code)
- T_Type (TEXT, fk → TrnsType.T_Type)
- T_Type_L (TEXT)
- Quantity (DECIMAL)
- Rate (DECIMAL)
- Amount (DECIMAL)
- Billed (TEXT, one of 'Y'/'N')
- Note (TEXT)

### TRNSACTN (joined outputs)
- File_No (TEXT)
- Id (TEXT)
- Footer_Code (TEXT)
- Date (DATE)
- Item_No (INTEGER)
- Empl_Num (TEXT)
- T_Code (TEXT)
- T_Type (TEXT)
- T_Type_L (TEXT)
- Quantity (DECIMAL)
- Rate (DECIMAL)
- Amount (DECIMAL)
- Billed (TEXT)
- Note (TEXT)

### TRNSLKUP (transaction codes)
- T_Code (TEXT, pk)
- T_Type (TEXT, fk → TrnsType.T_Type)
- T_Type_L (TEXT)
- Amount (DECIMAL)
- Description (TEXT)

### TRNSTYPE (transaction groups)
- T_Type (TEXT, pk)
- T_Type_L (TEXT)
- Header (TEXT)
- Footer (TEXT)

### FILESTAT
- Status (TEXT, pk)
- Definition (TEXT)
- Send (TEXT)
- Footer_Code (TEXT, fk → Footers.F_Code)

### FOOTERS
- F_Code (TEXT, pk)
- F_Footer (TEXT)

### EMPLOYEE
- Empl_Num (TEXT, pk)
- Empl_Id (TEXT, fk → Rolodex.Id)
- Rate_Per_Hour (DECIMAL)

### STATES
- Abrev (TEXT, pk)
- St (TEXT)

### GRUPLKUP
- Code (TEXT, pk)
- Description (TEXT)
- Title (TEXT)

### SETUP
- Appl_Title (TEXT)
- L_Head1..L_Head10 (TEXT)
- Default_Printer (INTEGER, fk → Printers.Number)

### PRINTERS
- Number (INTEGER, pk)
- Name (TEXT)
- Port (TEXT)
- Page_Break (TEXT)
- Setup_St (TEXT)
- Phone_Book (TEXT)
- Rolodex_Info (TEXT)
- Envelope (TEXT)
- File_Cabinet (TEXT)
- Accounts (TEXT)
- Statements (TEXT)
- Calendar (TEXT)
- Reset_St (TEXT)
- B_Underline (TEXT)
- E_Underline (TEXT)
- B_Bold (TEXT)
- E_Bold (TEXT)

### DEPOSITS / PAYMENTS
- Deposits
  - Deposit_Date (DATE, pk?)
  - Total (DECIMAL)
- Payments
  - Deposit_Date (DATE, fk → Deposits.Deposit_Date)
  - File_No (TEXT, fk → Files.File_No)
  - Id (TEXT, fk → Rolodex.Id)
  - Regarding (TEXT)
  - Amount (DECIMAL)
  - Note (TEXT)

### QDROS
- File_No (TEXT)
- Version (TEXT)
- Plan_Id (TEXT)
- ^1, ^2, ^Part, ^AltP, ^Pet, ^Res (TEXT)
- Case_Type (TEXT)
- Case_Code (TEXT)
- Section (TEXT)
- Case_Number (TEXT)
- Judgment_Date (DATE)
- Valuation_Date (DATE)
- Married_On (DATE)
- Percent_Awarded (DECIMAL)
- Ven_City (TEXT)
- Ven_Cnty (TEXT)
- Ven_St (TEXT)
- Draft_Out (DATE)
- Draft_Apr (DATE)
- Final_Out (DATE)
- Judge (TEXT)
- Form_Name (TEXT)

### PLANINFO
- Plan_Id (TEXT, pk)
- Plan_Name (TEXT)
- Plan_Type (TEXT)
- Empl_Id_No (TEXT)
- Plan_No (TEXT)
- NRA (TEXT)
- ERA (TEXT)
- ERRF (TEXT)
- COLAS (TEXT)
- Divided_By (TEXT)
- Drafted (TEXT)
- Benefit_C (TEXT)
- QDRO_C (TEXT)
- ^REV (TEXT)
- ^PA (TEXT)
- Form_Name (TEXT)
- Drafted_On (DATE)
- Memo (TEXT)

### PENSIONS (and related)
- PENSIONS
  - File_No (TEXT)
  - Version (TEXT)
  - Plan_Id (TEXT)
  - Plan_Name (TEXT)
  - Title (TEXT)
  - First (TEXT)
  - Last (TEXT)
  - Birth (DATE)
  - Race (TEXT)
  - Sex (TEXT)
  - Info (DATE)
  - Valu (DATE)
  - Accrued (DECIMAL)
  - Vested_Per (DECIMAL)
  - Start_Age (DECIMAL)
  - COLA (DECIMAL)
  - Max_COLA (DECIMAL)
  - Withdrawal (DECIMAL)
  - Pre_DR (DECIMAL)
  - Post_DR (DECIMAL)
  - Tax_Rate (DECIMAL)
- RESULTS
  - Accrued, Start_Age, COLA, Withdrawal, Pre_DR, Post_DR, Tax_Rate,
  - Age, Years_From, Life_Exp, EV_Monthly, Payments, Pay_Out,
  - Fund_Value, PV, Mortality, PV_AM, PV_AMT, PV_Pre_DB, PV_Annuity,
  - WV_AT, PV_Plan, Years_Married, Years_Service, Marr_Per, Marr_Amt
- MARRIAGE
  - File_No, Version, Married_From, Married_To, Married_Years,
  - Service_From, Service_To, Service_Years, Marital_%
- DEATH
  - File_No, Version, Lump1, Lump2, Growth1, Growth2, Disc1, Disc2
- SCHEDULE
  - File_No, Version, Vests_On (DATE), Vests_At (DECIMAL)
- SEPARATE
  - File_No, Version, Separation_Rate (DECIMAL)
- Life Tables (reference data)
  - FORMS/LIFETABL, FORMS/NUMBERAL, PENSIONS/LIFETABL, PENSIONS/NUMBERAL


