mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-01-29 19:51:05 -05:00
* Improve code style and PSR-12 compliance - refactored code formatting to adhere to PSR-12 guidelines - standardized coding conventions across the codebase - added missing framework files and reverted markup changes - reformatted arrays for enhanced readability - updated language files for consistent styling and clarity - minor miscellaneous improvements
35 lines
919 B
PHP
35 lines
919 B
PHP
<?php
|
|
|
|
namespace App\Database\Migrations;
|
|
|
|
use CodeIgniter\Database\Migration;
|
|
|
|
class Migration_image_upload_defaults extends Migration
|
|
{
|
|
/**
|
|
* Perform a migration step.
|
|
*/
|
|
public function up(): void
|
|
{
|
|
$image_values = [
|
|
['key' => 'image_allowed_types', 'value' => 'gif|jpg|png'],
|
|
['key' => 'image_max_height', 'value' => '480'],
|
|
['key' => 'image_max_size', 'value' => '128'],
|
|
['key' => 'image_max_width', 'value' => '640']
|
|
];
|
|
|
|
$builder = $this->db->table('app_config');
|
|
$builder->insertBatch($image_values);
|
|
}
|
|
|
|
/**
|
|
* Revert a migration step.
|
|
*/
|
|
public function down(): void
|
|
{
|
|
$builder = $this->db->table('app_config');
|
|
$builder->whereIn('key', ['image_allowed_types', 'image_max_height', 'image_max_size', 'image_max_width']);
|
|
$builder->delete();
|
|
}
|
|
}
|