134 lines
4.0 KiB
PHP
134 lines
4.0 KiB
PHP
<?php
|
|
|
|
use humhub\components\Migration;
|
|
|
|
class m260402_070000_lock_requirement_default_fields extends Migration
|
|
{
|
|
public function safeUp()
|
|
{
|
|
if ($this->db->getSchema()->getTableSchema('rescue_field_definition', true) === null) {
|
|
return;
|
|
}
|
|
|
|
$fieldKeys = [
|
|
'dob',
|
|
'age',
|
|
'previous_owner_user_id',
|
|
'previous_owner_name',
|
|
'previous_owner_business_name',
|
|
'previous_owner_street_address',
|
|
'previous_owner_city',
|
|
'previous_owner_state',
|
|
'previous_owner_zip',
|
|
'previous_owner_cell_phone',
|
|
'previous_owner_business_phone',
|
|
'previous_owner_email',
|
|
'lineage',
|
|
'backstory',
|
|
'rescue',
|
|
'weight',
|
|
'pulse',
|
|
'blood_pressure',
|
|
'oxygen',
|
|
'chronic_conditions',
|
|
'acute_conditions',
|
|
'special_needs',
|
|
'date_of_most_recent_medical_visit',
|
|
'physician_name',
|
|
'physician_business_name',
|
|
'physician_street_address',
|
|
'physician_city',
|
|
'physician_state',
|
|
'physician_zip',
|
|
'physician_cell_phone',
|
|
'physician_business_phone',
|
|
'physician_license_number',
|
|
'second_physician_name',
|
|
'second_physician_business_name',
|
|
'second_physician_street_address',
|
|
'second_physician_city',
|
|
'second_physician_state',
|
|
'second_physician_zip',
|
|
'second_physician_cell_phone',
|
|
'second_physician_business_phone',
|
|
'second_physician_license_number',
|
|
'previous_physicians',
|
|
'progress_notes',
|
|
'routine_updates',
|
|
'media_reference',
|
|
];
|
|
|
|
$this->update('rescue_field_definition', [
|
|
'is_core' => 1,
|
|
'is_active' => 1,
|
|
'updated_at' => date('Y-m-d H:i:s'),
|
|
], [
|
|
'module_id' => 'animal_management',
|
|
'field_key' => $fieldKeys,
|
|
]);
|
|
}
|
|
|
|
public function safeDown()
|
|
{
|
|
if ($this->db->getSchema()->getTableSchema('rescue_field_definition', true) === null) {
|
|
return;
|
|
}
|
|
|
|
$fieldKeys = [
|
|
'dob',
|
|
'age',
|
|
'previous_owner_user_id',
|
|
'previous_owner_name',
|
|
'previous_owner_business_name',
|
|
'previous_owner_street_address',
|
|
'previous_owner_city',
|
|
'previous_owner_state',
|
|
'previous_owner_zip',
|
|
'previous_owner_cell_phone',
|
|
'previous_owner_business_phone',
|
|
'previous_owner_email',
|
|
'lineage',
|
|
'backstory',
|
|
'rescue',
|
|
'weight',
|
|
'pulse',
|
|
'blood_pressure',
|
|
'oxygen',
|
|
'chronic_conditions',
|
|
'acute_conditions',
|
|
'special_needs',
|
|
'date_of_most_recent_medical_visit',
|
|
'physician_name',
|
|
'physician_business_name',
|
|
'physician_street_address',
|
|
'physician_city',
|
|
'physician_state',
|
|
'physician_zip',
|
|
'physician_cell_phone',
|
|
'physician_business_phone',
|
|
'physician_license_number',
|
|
'second_physician_name',
|
|
'second_physician_business_name',
|
|
'second_physician_street_address',
|
|
'second_physician_city',
|
|
'second_physician_state',
|
|
'second_physician_zip',
|
|
'second_physician_cell_phone',
|
|
'second_physician_business_phone',
|
|
'second_physician_license_number',
|
|
'previous_physicians',
|
|
'progress_notes',
|
|
'routine_updates',
|
|
'media_reference',
|
|
];
|
|
|
|
$this->update('rescue_field_definition', [
|
|
'is_core' => 0,
|
|
'updated_at' => date('Y-m-d H:i:s'),
|
|
], [
|
|
'module_id' => 'animal_management',
|
|
'field_key' => $fieldKeys,
|
|
]);
|
|
}
|
|
}
|