addSql('ALTER TABLE patient_sessions ' . 'ADD gross_total_rials INT DEFAULT 0 NOT NULL, ' . 'ADD base_insurance_rials INT DEFAULT 0 NOT NULL, ' . 'ADD supplementary_insurance_rials INT DEFAULT 0 NOT NULL, ' . 'ADD patient_share_rials INT DEFAULT 0 NOT NULL'); // Existing sessions were computed without an insurance breakdown: the whole // amount was the patient's share. Backfilling this way keeps their totals unchanged. $this->addSql('UPDATE patient_sessions SET ' . 'patient_share_rials = final_price_rials, ' . 'gross_total_rials = final_price_rials, ' . 'base_insurance_rials = 0, ' . 'supplementary_insurance_rials = 0'); } public function down(Schema $schema): void { $this->addSql('ALTER TABLE patient_sessions ' . 'DROP gross_total_rials, ' . 'DROP base_insurance_rials, ' . 'DROP supplementary_insurance_rials, ' . 'DROP patient_share_rials'); } }