mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-09-21 10:15:01 -04:00
- Register jobs module, permission, and admin grant so it appears in menu/ACL (20260916000000_AddJobsModule.php) - Add job_throttles table to support rate-limiting job runs (20260916000001_CreateJobThrottles.php) - Seed app_config with jobs_mode and jobs_web_max_seconds defaults for web-based job execution (20260916000002_AddJobsConfigKeys.php) - Drop redundant FK re-add in fix_keys_for_db_upgrade migration that duplicated an already-existing constraint Signed-off-by: objecttothis <17935339+objecttothis@users.noreply.github.com>
31 lines
670 B
PHP
31 lines
670 B
PHP
<?php
|
|
|
|
namespace App\Database\Migrations;
|
|
|
|
use CodeIgniter\Database\Migration;
|
|
|
|
class AddJobsConfigKeys extends Migration
|
|
{
|
|
public function up(): void
|
|
{
|
|
$jobsConfigValues = [
|
|
['key' => 'jobs_mode', 'value' => 'web'],
|
|
['key' => 'jobs_web_max_seconds', 'value' => '5'],
|
|
];
|
|
|
|
$this->db->table('app_config')->ignore(true)->insertBatch($jobsConfigValues);
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
$jobsConfigKeys = [
|
|
'jobs_mode',
|
|
'jobs_web_max_seconds',
|
|
];
|
|
|
|
$this->db->table('app_config')
|
|
->whereIn('key', $jobsConfigKeys)
|
|
->delete();
|
|
}
|
|
}
|