fichaje automatico y escaneo

This commit is contained in:
amazuecos
2025-05-05 00:47:00 +02:00
parent fb7f2a28d9
commit 305eea00e6
19 changed files with 821 additions and 25 deletions

View File

@ -0,0 +1,58 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
use CodeIgniter\Database\RawSql;
class MaquinaOtTareasTable extends Migration
{
protected array $COLUMNS = [
'id' => [
'type' => 'INT',
'unsigned' => true,
'auto_increment' => true,
],
'maquina_id' => [
'type' => 'INT',
'unsigned' => true,
'constraint' => 11
],
'orden_trabajo_id' => [
'type' => 'INT',
'unsigned' => true,
],
];
public function up()
{
$this->forge->addField($this->COLUMNS);
$currenttime = new RawSql('CURRENT_TIMESTAMP');
$this->forge->addField([
'created_at' => [
'type' => 'TIMESTAMP',
'default' => $currenttime,
],
'updated_at' => [
'type' => 'TIMESTAMP',
'null' => true,
],
'deleted_at' => [
'type' => 'TIMESTAMP',
'null' => true,
],
]);
$this->forge->addPrimaryKey('id');
$this->forge->addForeignKey('maquina_id','lg_maquinas','id','CASCADE','CASCADE','maquina_ot_tareas_maquina_id_fk');
$this->forge->addForeignKey('orden_trabajo_id','ordenes_trabajo','id','CASCADE','CASCADE','maquina_ot_tareas_ot_id_fk');
$this->forge->createTable("maquina_ot_tareas");
}
public function down()
{
$this->forge->dropTable("maquina_ot_tareas");
}
}