Files
alrahma_sunday_school/app/Database/Migrations/2026-09-02-000100_AddHideJobOpeningsPopupToPreferences.php
root 02fd6e4863
Deploy to Shared Hosting / Shared hosting deploy (push) Failing after 48s
Tests / PHPUnit (push) Successful in 1m21s
add feature do not show again job for parent portal
2026-09-03 00:02:07 -04:00

43 lines
1.1 KiB
PHP

<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class AddHideJobOpeningsPopupToPreferences extends Migration
{
public function up()
{
if (! $this->db->tableExists('user_preferences')) {
return;
}
if (! $this->db->fieldExists('hide_job_openings_popup', 'user_preferences')) {
$definition = [
'type' => 'TINYINT',
'constraint' => 1,
'default' => 0,
'null' => false,
];
if ($this->db->fieldExists('menu_custom_mode', 'user_preferences')) {
$definition['after'] = 'menu_custom_mode';
}
$this->forge->addColumn('user_preferences', [
'hide_job_openings_popup' => $definition,
]);
}
}
public function down()
{
if (
$this->db->tableExists('user_preferences')
&& $this->db->fieldExists('hide_job_openings_popup', 'user_preferences')
) {
$this->forge->dropColumn('user_preferences', 'hide_job_openings_popup');
}
}
}