Merge branch 'main' into 'add/view_logistica_principal'

Main

See merge request jjimenez/safekat!710
This commit is contained in:
2025-04-16 16:24:25 +00:00
21 changed files with 777 additions and 164 deletions

View File

@ -0,0 +1,41 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
use CodeIgniter\Database\RawSql;
class AddEspiralOrdenTrabajoDates extends Migration
{
protected array $DATES = [
"espiral_at" => [
"type" => "DATE",
"null" => true,
],
];
protected array $USERS = [
"espiral_user_id" => [
"type" => "INT",
"unsigned" => true,
"constraint" => 10,
"null" => true,
],
];
public function up()
{
$this->forge->addColumn("orden_trabajo_dates", $this->DATES);
$this->forge->addColumn("orden_trabajo_users", $this->USERS);
foreach ($this->USERS as $key => $value) {
$this->forge->addForeignKey([$key],"users",["id"]);
}
}
public function down()
{
$this->forge->dropColumn("orden_trabajo_dates", array_keys($this->DATES));
$this->forge->dropColumn("orden_trabajo_users", array_keys($this->USERS));
}
}