mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-03-12 04:02:19 -04:00
* `execute_script()` now returns a boolean for error handling. * Added transaction to `Migration_MissingConfigKeys.up()`. * Added logging to various migrations. * Added transaction to `Migration_MissingConfigKeys.up()`. * Added logging to various migrations. * Formatting and function call fixes Fixed a minor formatting issue in the migration helper. Replaced a few remaining error_log() calls. Updated executeScriptWithTransaction() to use log_message() * Function call fix Replaced the last error_log() calls with log_message(). --------- Co-authored-by: Joe Williams <hey-there-joe@outlook.com>
37 lines
1.2 KiB
PHP
37 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Database\Migrations;
|
|
|
|
use CodeIgniter\Database\Migration;
|
|
|
|
class Migration_add_missing_config extends Migration
|
|
{
|
|
/**
|
|
* Perform a migration step.
|
|
*/
|
|
public function up(): void
|
|
{
|
|
log_message('info', 'Adding missing configs.');
|
|
$image_values = [
|
|
['key' => 'account_number', 'value' => ''], // This has no current maintenance, but it's used in Sales
|
|
['key' => 'category_dropdown', 'value' => ''],
|
|
['key' => 'smtp_host', 'value' => ''],
|
|
['key' => 'smtp_user', 'value' => ''],
|
|
['key' => 'smtp_pass', 'value' => ''],
|
|
['key' => 'login_form', 'value' => ''],
|
|
['key' => 'receiving_calculate_average_price', 'value' => ''],
|
|
['key' => 'payment_message', 'value' => '']
|
|
];
|
|
|
|
$this->db->table('app_config')->ignore(true)->insertBatch($image_values);
|
|
}
|
|
|
|
/**
|
|
* Revert a migration step.
|
|
*/
|
|
public function down(): void
|
|
{
|
|
// No need to remove necessary config values.
|
|
}
|
|
}
|