33 lines
876 B
PHP
33 lines
876 B
PHP
<?php
|
|
|
|
namespace App\Database\Migrations;
|
|
|
|
use CodeIgniter\Database\Migration;
|
|
|
|
class AddDetailsClickCountToJobPositions extends Migration
|
|
{
|
|
public function up()
|
|
{
|
|
if (!$this->db->tableExists('job_positions') || $this->db->fieldExists('details_click_count', 'job_positions')) {
|
|
return;
|
|
}
|
|
|
|
$this->forge->addColumn('job_positions', [
|
|
'details_click_count' => [
|
|
'type' => 'INT',
|
|
'constraint' => 11,
|
|
'unsigned' => true,
|
|
'default' => 0,
|
|
'after' => 'posted_at',
|
|
],
|
|
]);
|
|
}
|
|
|
|
public function down()
|
|
{
|
|
if ($this->db->tableExists('job_positions') && $this->db->fieldExists('details_click_count', 'job_positions')) {
|
|
$this->forge->dropColumn('job_positions', 'details_click_count');
|
|
}
|
|
}
|
|
}
|