addSql('CREATE TABLE insurance_coverage_defaults (id INT AUTO_INCREMENT NOT NULL, insurance_id INT NOT NULL, service_category VARCHAR(30) NOT NULL, coverage_percent NUMERIC(5, 2) NOT NULL, updated_at INT NOT NULL, UNIQUE INDEX uniq_insurance_service_category (insurance_id, service_category), PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8mb4'); // Every insurance gets a full row set so the admin panel always shows a complete // grid: a missing row must never be read as "0% on purpose". foreach (['outpatient', 'inpatient'] as $category) { $this->addSql( 'INSERT INTO insurance_coverage_defaults (insurance_id, service_category, coverage_percent, updated_at) SELECT i.id, :category, 0.00, UNIX_TIMESTAMP() FROM insurances i', ['category' => $category], ); } } public function down(Schema $schema): void { $this->addSql('DROP TABLE insurance_coverage_defaults'); } }