<?php

namespace App\Database\Migrations;

use CodeIgniter\Database\Migration;
use CodeIgniter\Database\RawSql;

class AddFkEsquemaImposiciones extends Migration
{


    public function up()
    {
        $this->forge->addColumn("lg_imposiciones", [
            "imposicion_esquema_id" => [
                "type" => "INT",
                "unsigned" => true,
                "null" => true
            ]
        ]);
        $this->forge->addForeignKey(["imposicion_esquema_id"],"imposicion_esquemas",["id"],'SET NULL','SET NULL');
        $this->forge->processIndexes("lg_imposiciones");
    }

    public function down()
    {
        $this->forge->dropForeignKey("lg_imposiciones","lg_imposiciones_imposicion_esquema_id_foreign");
        $this->forge->dropColumn("lg_imposiciones","imposicion_esquema_id");

    }
}
