fix positions
Deploy to Shared Hosting / Shared hosting deploy (push) Failing after 54s
Tests / PHPUnit (push) Successful in 1m22s

This commit is contained in:
root
2026-09-03 03:21:37 -04:00
parent 6936a822c8
commit c70f6bdc6e
12 changed files with 344 additions and 18 deletions
@@ -0,0 +1,26 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class BackfillPostedAtForClosedFilledJobPositions extends Migration
{
public function up()
{
if (!$this->db->tableExists('job_positions') || !$this->db->fieldExists('posted_at', 'job_positions')) {
return;
}
$this->db->table('job_positions')
->whereIn('status', ['closed', 'filled'])
->where('posted_at', null)
->set('posted_at', 'COALESCE(created_at, updated_at)', false)
->update();
}
public function down()
{
// Data-only fallback for legacy rows.
}
}