mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
ot tareas new migrations
This commit is contained in:
@ -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));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user