mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-09-20 17:57:12 -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>
37 lines
976 B
PHP
37 lines
976 B
PHP
<?php
|
|
|
|
namespace App\Database\Migrations;
|
|
|
|
use CodeIgniter\Database\Migration;
|
|
|
|
class AddJobsModule extends Migration
|
|
{
|
|
public function up(): void
|
|
{
|
|
$this->db->table('modules')->insert([
|
|
'module_id' => 'jobs',
|
|
'name_lang_key' => 'jobs',
|
|
'desc_lang_key' => 'jobs_desc',
|
|
'sort' => 130,
|
|
]);
|
|
|
|
$this->db->table('permissions')->insert([
|
|
'permission_id' => 'jobs',
|
|
'module_id' => 'jobs',
|
|
]);
|
|
|
|
$this->db->table('grants')->insert([
|
|
'permission_id' => 'jobs',
|
|
'person_id' => 1,
|
|
'menu_group' => 'office',
|
|
]);
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
$this->db->table('grants')->where('permission_id', 'jobs')->delete();
|
|
$this->db->table('permissions')->where('permission_id', 'jobs')->delete();
|
|
$this->db->table('modules')->where('module_id', 'jobs')->delete();
|
|
}
|
|
}
|