Database Migrations

๐Ÿ—„๏ธ Database Migrations

Manage database schema changes across all agency databases

โš ๏ธ Important Safety Guidelines:
  • Always backup databases before running migrations
  • Test in development environment first
  • Use preview mode to verify SQL before executing
  • Run during off-hours when possible to minimize impact
  • Have rollback plan ready if issues occur
๐Ÿš€ Available Migrations
๐Ÿ”ง Generic Column Creator
Universal tool to add any column to any table across all agency databases. Features form-based interface with preview mode and validation.
โœจ Most Flexible | ๐Ÿ“ Form-Based | ๐Ÿ” SQL Preview
Use Generic Tool โ†’
๐Ÿ’ฐ Adjust Contract Balance Field
Adds adjust_contract_balance column to Visits_payments for tracking whether write-off amounts should be included in contract balance calculations for AR reporting.
๐Ÿ“… New | ๐Ÿ“‹ Table: Visits_payments | ๐Ÿ’ผ Billing Feature
Run Migration โ†’
โš•๏ธ Unstable Action Field
Adds unstable_action column to pSchedules for tracking clinician actions when handling unstable patient vitals/symptoms.
๐Ÿ“… Created: 2024-12-03 | ๐Ÿ“‹ Table: pSchedules
Run Migration โ†’
๐Ÿฉน Wound Tunneling & Undermining
Adds wnd_tunneling and wnd_underm columns to pWoundsVitals and pProgress tables for tracking wound characteristics.
๐Ÿ“… New | ๐Ÿ“‹ Tables: pWoundsVitals, pProgress | ๐Ÿ”ข 2 Columns Each
Run Migration โ†’
๐Ÿฉน Wound Assessment Fields
Adds wnd_gran, wnd_epith, wnd_eschar, wnd_slough, and wnd_fib columns to pWoundsVitals and pProgress tables for comprehensive wound assessment tracking.
๐Ÿ“… New | ๐Ÿ“‹ Tables: pWoundsVitals, pProgress | ๐Ÿ”ข 5 Columns Each
Run Migration โ†’
๐Ÿ“ก Agency EVV_Transmission
Adds EVV_Transmission to lookup Agency (auto_send or manual_trans / review first).
๐Ÿ“… #10527 | ๐Ÿ“‹ Table: Agency | ๐Ÿ”ข 1 Column
Run Migration โ†’
๐Ÿ“‹ EVV Payer Required Field
Adds evv_payer_required column to pPayer (INT NOT NULL DEFAULT 0, after EVV) for all agency databases.
๐Ÿ“… New | ๐Ÿ“‹ Table: pPayer | ๐Ÿ”ข 1 Column
Run Migration โ†’
๐Ÿ“ก EVV Patient Automation Queue
Creates EVV_Patient_Automation table in hhapowerpath for automated patient EVV JSON transmit and status polling (tickets 10421-10425).
๐Ÿ“… New | ๐Ÿ“‹ Table: EVV_Patient_Automation | ๐Ÿ”ข Queue + status polling
Run Migration โ†’
๐Ÿ“ก EVV Visit Automation Queue
Creates EVV_Visit_Automation table in hhapowerpath for automated visit EVV transmit and status polling (tickets 10426-10429).
๐Ÿ“… New | ๐Ÿ“‹ Table: EVV_Visit_Automation | ๐Ÿ”ข Queue + status polling
Run Migration โ†’
๐Ÿ“ก EVV Visit Automation Status
Adds Status (0 active) to EVV_Visit_Automation for manual transmission and queue filtering.
๐Ÿ“… New | ๐Ÿ“‹ Column: Status | ๐Ÿ”ข 0 = active
Run Migration โ†’
๐Ÿ“‹ 485/487 Checking on pPayer
Adds checking_485 and checking_487 columns to pPayer for payer setup controls.
๐Ÿ“… New | ๐Ÿ“‹ Table: pPayer | ๐Ÿ”ข 2 Columns
Run Migration โ†’
๐Ÿ“‹ EVV Reason Codes Setup
Creates EVV_Reason_Codes and EVV_Update_Log tables. Adds EVV_Reason_Code_ID to pSchedules for tracking visit update reasons.
๐Ÿ“… Previously Run | ๐Ÿ“‹ Tables: Multiple
View/Run โ†’
๐Ÿ“„ Document Expiration Date
Adds date_expire field to document description tables for tracking document expiration dates.
๐Ÿ“… Previously Available | ๐Ÿ“‹ Table: DocumentDesc
View/Run โ†’
๐Ÿ“‹ Communication Certification Period
Adds certification period columns to Communication table for storing CTI (Physician Certification of Terminal Illness) certification period information.
๐Ÿ“… New | ๐Ÿ“‹ Table: Communication | ๐Ÿ”ข 3 Columns
View/Run โ†’
๐Ÿ“ Communication Subjects (CTI & Face to Face)
Adds "Physician Certification of Terminal Illness" and "Face to Face Encounter" subjects to CommunicationSubjects table for all agencies.
๐Ÿ“… New | ๐Ÿ“‹ Table: CommunicationSubjects | ๐Ÿ”ข 2 Subjects
View/Run โ†’
๐Ÿ“ Communication Encounter Location
Adds Encounter_Location column to Communication table for storing location information in Face to Face Encounter communications.
๐Ÿ“… New | ๐Ÿ“‹ Table: Communication | ๐Ÿ”ข 1 Column
View/Run โ†’
๐Ÿ“‹ Copy SN Evaluation to Palliative
Copies all assessment questions and answers from 'SN Evaluation' to 'Palliative' in the lookup database. Issue #9907.
๐Ÿ“… New | ๐Ÿ“‹ Tables: assessment_questions_lookup, assessment_answers_lookup | ๐Ÿ”„ Data Copy
Run Migration โ†’
๐Ÿ“‘ Create assessment_*_lookup_PATTII Tables
Creates assessment_questions_lookup_PATTII and assessment_answers_lookup_PATTII and copies all data from the current lookup tables. Issue #10641.
๐Ÿ“… New | ๐Ÿ“‹ Lookup DB | ๐Ÿ”„ CREATE TABLE LIKE + full data copy
Run Migration โ†’
๐Ÿฅ Add PEGGII to Agency
Adds PEGGII (PEGGii Patient Engagement) Yes/No setup field to the lookup Agency table. Default is Yes. Issue #10669.
๐Ÿ“… New | ๐Ÿ“‹ Lookup DB Agency | ๐Ÿ”„ ALTER TABLE ADD COLUMN
Run Migration โ†’
โœ‰๏ธ Add no_email to pPatients
Adds no_email checkbox to pPatients. Email is required unless No email is checked. Default is email required. Issue #10670.
๐Ÿ“… New | ๐Ÿ“‹ pPatients (all agencies) | ๐Ÿ”„ ALTER TABLE ADD COLUMN
Run Migration โ†’
๐Ÿ”€ Toggle PATTII Assessment Lookup Flag
Turn ON/OFF use of assessment_*_lookup_PATTII for OASIS/eval wizards, Mobile API, and Whisper API. Issue #10641.
๐Ÿ“… New | โš™๏ธ Application.use_assessment_lookup_PATTII
Toggle Flag โ†’
โšก EVV Auto-Status Triggers
Updates database triggers to automatically set "Data Changed - Retransmission Required" status when EVV data is modified.
๐Ÿ“… Previously Available | ๐Ÿ”„ Trigger Updates
View/Run โ†’
๐Ÿ‘ค Employee Auth QA Fields
Adds quality assurance fields to employee authorization tracking system.
๐Ÿ“… Previously Available | ๐Ÿ“‹ Table: Employee Auth
View/Run โ†’
๐Ÿฅ Create pInpatient_Hx Table
Creates pInpatient_Hx (inpatient admit/discharge history per admission and facility) on all agency databases.
๐Ÿ“… #10516 | ๐Ÿ“‹ Table: pInpatient_Hx | ๐Ÿฅ All agency_* DBs
Run Migration โ†’
๐Ÿ“‹ Create pAdmit_Forms Table
Creates pAdmit_Forms on all agency databases for admission packet data (consents, ACH, LEP, advance directives, HIPAA, emergency plan, signatures).
๐Ÿ“… New | ๐Ÿ“‹ Table: pAdmit_Forms | ๐Ÿฅ All agency_* DBs
Run Migration โ†’
๐Ÿงพ pAdmit_Forms CC Patient Columns
Adds cc_patient_name and cc_patient_id to pAdmit_Forms after ach_signature_date on all agency databases.
๐Ÿ“… New | ๐Ÿ“‹ Table: pAdmit_Forms | ๐Ÿฅ All agency_* DBs
Run Migration โ†’
๐Ÿ“„ pAdmit_Forms form_type & Notice Columns
Adds form_type (ADMISSION_PACKET / HHCCN / NOMNC) and notice signature/date fields to pAdmit_Forms on all agency databases, plus related indexes.
๐Ÿ“… New | ๐Ÿ“‹ Table: pAdmit_Forms | ๐Ÿฅ All agency_* DBs
Run Migration โ†’
๐Ÿ“š Documentation & Tools

Migration Best Practices:

  1. Read Documentation: Check README files for each migration
  2. Backup First: Always backup databases before schema changes
  3. Test in Dev: Run migrations in development before production
  4. Use Preview: Most tools offer SQL preview mode
  5. Monitor Progress: Watch for errors during execution
  6. Verify Results: Check at least one agency database after migration
  7. Document Changes: Update documentation when creating new migrations
๐Ÿ”— Quick Access
๐Ÿ’ก Need to Create a New Migration?
  1. Use the Generic Column Tool for simple column additions
  2. For complex migrations, copy an existing migration file as template
  3. Add your migration case to database_migration.cfm
  4. Document your migration with a README file
  5. Test thoroughly before running on production

Migration System | PowerPath EMR | Version 2.0
Last Updated: December 2024