ot tareas new migrations

This commit is contained in:
amazuecos
2025-04-22 10:07:03 +02:00
parent 62a95a0ca8
commit 92a6a3c16c
2 changed files with 78 additions and 0 deletions

View File

@ -0,0 +1,30 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
use CodeIgniter\Database\RawSql;
class AddMaquinistaFieldsOrdenTrabajoTareas extends Migration
{
protected array $COLUMNS = [
"estado" => [
"type" => "ENUM",
"constraint" => ["P","I","D","F","E"],
"default" => "P",
"comment" => "(P)ENDING,(I)NIT,(D)ELAY,(F)INISHED,(E)RROR"
]
];
public function up()
{
$this->forge->addColumn("orden_trabajo_tareas", $this->COLUMNS);
}
public function down()
{
$this->forge->dropColumn("orden_trabajo_tareas",array_keys($this->COLUMNS));
}
}

View File

@ -0,0 +1,48 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class AddTableOrdenTrabajoTareaProgressDates extends Migration
{
protected array $COLUMNS = [
"id" => [
"type" => "INT",
"unsigned" => true,
"auto_increment" => true,
],
"init_at" => [
"type" => "INT",
"unsigned" => "INT",
"comment" => "Timestamp task init"
],
"end_at" => [
"type" => "INT",
"unsigned" => "INT",
"comment" => "Timestamp task finish"
],
"init_user_id" => [
"type" => "INT",
"unsigned" => true,
"constraint" => 11
],
"end_user_id" => [
"type" => "INT",
"unsigned" => true,
"constraint" => 11
],
];
public function up()
{
$this->forge->addField($this->COLUMNS);
$this->forge->addPrimaryKey('id');
}
public function down()
{
$this->forge->dropColumn("orden_trabajo_tareas",array_keys($this->COLUMNS));
}
}