tarifa maquinas

This commit is contained in:
amazuecos
2024-12-18 09:30:21 +01:00
parent 43f2daea59
commit 41b4ec5cd3
20 changed files with 864 additions and 0 deletions

View File

@ -0,0 +1,55 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
use CodeIgniter\Database\RawSql;
class MaquinaTareasTable extends Migration
{
protected array $COLUMNS = [
'id' => [
'type' => 'INT',
'unsigned' => true,
'auto_increment' => true,
],
'name' => [
'type' => 'VARCHAR',
'constraint' => 255,
],
'description' => [
'type' => 'LONGTEXT',
'default' => null,
'null' => 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->createTable("maquina_tareas");
}
public function down()
{
$this->forge->dropTable("maquina_tareas");
}
}

View File

@ -0,0 +1,64 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
use CodeIgniter\Database\RawSql;
class TarifaAcabadoMaquinaTable extends Migration
{
protected array $COLUMNS = [
'id' => [
'type' => 'INT',
'unsigned' => true,
'auto_increment' => true,
],
'tarifa_acabado_id' => [
'type' => 'INT',
'unsigned' => true,
'constraint' => 10,
],
'maquina_id' => [
'type' => 'INT',
'unsigned' => true,
'constraint' => 10,
],
'maquina_tarea_id' => [
'type' => 'INT',
'unsigned' => true,
'constraint' => 10,
]
];
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('tarifa_acabado_id','lg_tarifa_acabado','id');
$this->forge->addForeignKey('maquina_tarea_id','maquina_tareas','id');
$this->forge->createTable("tarifa_acabado_maquinas");
}
public function down()
{
$this->forge->dropTable("tarifa_acabado_maquinas");
}
}

View File

@ -0,0 +1,64 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
use CodeIgniter\Database\RawSql;
class TarifaManipuladoMaquinaTable extends Migration
{
protected array $COLUMNS = [
'id' => [
'type' => 'INT',
'unsigned' => true,
'auto_increment' => true,
],
'tarifa_manipulado_id' => [
'type' => 'INT',
'unsigned' => true,
'constraint' => 10,
],
'maquina_id' => [
'type' => 'INT',
'unsigned' => true,
'constraint' => 10,
],
'maquina_tarea_id' => [
'type' => 'INT',
'unsigned' => true,
'constraint' => 10,
]
];
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('tarifa_manipulado_id','lg_tarifa_manipulado','id');
$this->forge->addForeignKey('maquina_tarea_id','maquina_tareas','id');
$this->forge->createTable("tarifa_manipulado_maquinas");
}
public function down()
{
$this->forge->dropTable("tarifa_manipulado_maquinas");
}
}

View File

@ -0,0 +1,65 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
use CodeIgniter\Database\RawSql;
class TarifaPreimpresionMaquinaTable extends Migration
{
protected array $COLUMNS = [
'id' => [
'type' => 'INT',
'unsigned' => true,
'auto_increment' => true,
],
'tarifa_preimpresion_id' => [
'type' => 'INT',
'unsigned' => true,
'constraint' => 10,
],
'maquina_id' => [
'type' => 'INT',
'unsigned' => true,
'constraint' => 10,
],
'maquina_tarea_id' => [
'type' => 'INT',
'unsigned' => true,
'constraint' => 10,
]
];
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('tarifa_preimpresion_id','lg_tarifa_preimpresion','id');
$this->forge->addForeignKey('maquina_tarea_id','maquina_tareas','id');
$this->forge->createTable("tarifa_preimpresion_maquinas");
}
public function down()
{
$this->forge->dropTable("tarifa_preimpresion_maquinas");
}
}

View File

@ -0,0 +1,65 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
use CodeIgniter\Database\RawSql;
class TarifaEncuadernacionMaquinaTable extends Migration
{
protected array $COLUMNS = [
'id' => [
'type' => 'INT',
'unsigned' => true,
'auto_increment' => true,
],
'tarifa_encuadernacion_id' => [
'type' => 'INT',
'unsigned' => true,
'constraint' => 10,
],
'maquina_id' => [
'type' => 'INT',
'unsigned' => true,
'constraint' => 10,
],
'maquina_tarea_id' => [
'type' => 'INT',
'unsigned' => true,
'constraint' => 10,
]
];
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('tarifa_encuadernacion_id','tarifa_encuadernacion','id');
$this->forge->addForeignKey('maquina_tarea_id','maquina_tareas','id');
$this->forge->createTable("tarifa_encuadernacion_maquinas");
}
public function down()
{
$this->forge->dropTable("tarifa_encuadernacion_maquinas");
}
}

View File

@ -0,0 +1,65 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
use CodeIgniter\Database\RawSql;
class TarifaExtraMaquinaTable extends Migration
{
protected array $COLUMNS = [
'id' => [
'type' => 'INT',
'unsigned' => true,
'auto_increment' => true,
],
'tarifa_extra_id' => [
'type' => 'INT',
'unsigned' => true,
'constraint' => 10,
],
'maquina_id' => [
'type' => 'INT',
'unsigned' => true,
'constraint' => 10,
],
'maquina_tarea_id' => [
'type' => 'INT',
'unsigned' => true,
'constraint' => 10,
]
];
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('tarifa_extra_id','tarifa_extra','id');
$this->forge->addForeignKey('maquina_tarea_id','maquina_tareas','id');
$this->forge->createTable("tarifa_extra_maquinas");
}
public function down()
{
$this->forge->dropTable("tarifa_extra_maquinas");
}
}