mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
41 lines
1019 B
PHP
Executable File
41 lines
1019 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Database\Migrations;
|
|
|
|
use CodeIgniter\Database\Migration;
|
|
use CodeIgniter\Database\RawSql;
|
|
|
|
class AddFkOrdenTrabajoChatDepartment extends Migration
|
|
{
|
|
protected array $COLUMNS = [
|
|
"orden_trabajo_id" => [
|
|
"type" => "INT",
|
|
"constraint" => 10,
|
|
"unsigned" => true,
|
|
"null" => true
|
|
],
|
|
];
|
|
|
|
|
|
public function up()
|
|
{
|
|
$this->forge->addColumn("chats", $this->COLUMNS);
|
|
$this->forge->addColumn("chat_department_users", $this->COLUMNS);
|
|
$this->forge->addForeignKey('orden_trabajo_id', 'ordenes_trabajo', 'id');
|
|
$this->forge->processIndexes('chats');
|
|
$this->forge->addForeignKey('orden_trabajo_id', 'ordenes_trabajo', 'id');
|
|
$this->forge->processIndexes('chat_department_users');
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
public function down()
|
|
{
|
|
$this->forge->dropColumn("chats", ["orden_trabajo_id"]);
|
|
$this->forge->dropColumn("chat_department_users", ["orden_trabajo_id"]);
|
|
|
|
}
|
|
}
|