mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
ot pliegos
This commit is contained in:
@ -80,7 +80,7 @@ class CreateCatalogoLibros extends Migration
|
||||
$this->forge->addUniqueKey('isk');
|
||||
$this->forge->addForeignKey('cliente_id', 'clientes', 'id');
|
||||
|
||||
$this->forge->createTable('catalogo_libros');
|
||||
$this->forge->createTable('catalogo_libros',true);
|
||||
|
||||
$this->db->query('SET foreign_key_checks = 1');
|
||||
}
|
||||
|
||||
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
|
||||
class AddPliegoColumnOrdenTrabajoTarea extends Migration
|
||||
{
|
||||
|
||||
protected array $COLUMNS = [
|
||||
"pliego_1" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"default" => 0,
|
||||
],
|
||||
"pliego_1_total" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"default" => 0,
|
||||
],
|
||||
"pliego_2" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"default" => 0,
|
||||
],
|
||||
"pliego_2_total" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"default" => 0,
|
||||
],
|
||||
];
|
||||
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,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
|
||||
class AddPliegoColumnOrdenTrabajoTarea extends Migration
|
||||
{
|
||||
|
||||
|
||||
public function up()
|
||||
{
|
||||
$this->forge->dropForeignKey('orden_trabajo_tarea_progress_dates','orden_trabajo_tarea_progress_dates_ot_tarea_id_foreign');
|
||||
$this->forge->addForeignKey("ot_tarea_id","orden_trabajo_tareas","id",'CASCADE','CASCADE');
|
||||
$this->forge->processIndexes('orden_trabajo_tarea_progress_dates');
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropForeignKey('orden_trabajo_tarea_progress_dates','orden_trabajo_tarea_progress_dates_ot_tarea_id_foreign');
|
||||
$this->forge->addForeignKey("ot_tarea_id","orden_trabajo_tareas","id");
|
||||
$this->forge->processIndexes('orden_trabajo_tarea_progress_dates');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user