change migration

This commit is contained in:
amazuecos
2024-12-08 19:01:43 +01:00
parent 5ce47dc6ce
commit 0b4105f5bd

View File

@ -5,7 +5,7 @@ namespace App\Database\Migrations;
use CodeIgniter\Database\Migration; use CodeIgniter\Database\Migration;
use CodeIgniter\Database\RawSql; use CodeIgniter\Database\RawSql;
class TareasServicioTable extends Migration class ServicioClienteTareas extends Migration
{ {
protected array $COLUMNS = [ protected array $COLUMNS = [
"id" => [ "id" => [
@ -13,13 +13,21 @@ class TareasServicioTable extends Migration
"unsigned" => true, "unsigned" => true,
"autoincrement" => true "autoincrement" => true
], ],
"servicio_cliente_id" => [
"type" => "INT",
"unsigned" => true,
"comment" => "Servicio cliente asociado"
],
"tarifa_acabado_id" => [ "tarifa_acabado_id" => [
"type" => "INT", "type" => "INT",
"unsigned" => true, "unsigned" => true,
"comment" => "Tarifa de acabado asociada a servicio"
], ],
"tarifa_manipulado_id" => [ "tarifa_manipulado_id" => [
"type" => "INT", "type" => "INT",
"unsigned" => true, "unsigned" => true,
"comment" => "Tarifa de manipulado asociada a servicio"
] ]
]; ];
public function up() public function up()
@ -43,11 +51,14 @@ class TareasServicioTable extends Migration
], ],
]); ]);
$this->forge->createTable("tareas_servicio", true); $this->forge->addForeignKey('tarifa_acabado_id','lg_tarifa_acabado','id');
$this->forge->addForeignKey('tarifa_manipulado_id','lg_tarifa_manipulado','id');
$this->forge->createTable("servicio_cliente_tareas", true);
} }
public function down() public function down()
{ {
$this->forge->dropTable("tareas_servicio"); $this->forge->dropTable("servicio_cliente_tareas");
} }
} }