mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
34 lines
920 B
PHP
Executable File
34 lines
920 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Database\Migrations;
|
|
|
|
use CodeIgniter\Database\Migration;
|
|
|
|
class AlterOrdenesTrabajoAddCommentColumns extends Migration
|
|
{
|
|
protected array $COLUMNS = [
|
|
'preimpresion_revisada' => [
|
|
'type' => 'BOOL',
|
|
'default' => false
|
|
],
|
|
'preimpresion_revisada_by' => [
|
|
'type' => 'INT',
|
|
'unsigned' => true,
|
|
'constraint' => 11,
|
|
],
|
|
];
|
|
public function up()
|
|
{
|
|
|
|
$this->forge->addColumn('ordenes_trabajo',$this->COLUMNS);
|
|
$this->forge->addForeignKey('preimpresion_revisada_by','users','id','NULL','NULL');
|
|
$this->forge->processIndexes('ordenes_trabajo');
|
|
}
|
|
|
|
public function down()
|
|
{
|
|
$this->forge->dropForeignKey('ordenes_trabajo','ordenes_trabajo_preimpresion_revisada_by_foreign');
|
|
$this->forge->dropColumn('ordenes_trabajo',array_keys($this->COLUMNS));
|
|
}
|
|
}
|