<?php

namespace App\Database\Migrations;

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

class AddUserIDFechasEntregaPedido extends Migration
{
    protected array $USER_COLUMNS = [
        "inaplazable" => [
            "type" => "INT",
            "unsigned" => true,
            "constraint" => 1,
            "null" => true,
        ],
        'fecha_entrega_real_change_user_id' =>  [
            'type' => 'INT',
            "constraint" => 10,
            "unsigned" => true,
            "null" => true,
        ],
        "fecha_impresion_change_user_id" => [
            "type" => "INT",
            "constraint" => 10,
            "unsigned" => true,
            "null" => true,
        ],

        "fecha_encuadernado_change_user_id" => [
            "type" => "INT",
            "unsigned" => true,
            "constraint" => 10,
            "null" => true,
        ],
        "fecha_entrega_externo_change_user_id" => [
            "type" => "INT",
            "unsigned" => true,
            "constraint" => 10,
            "null" => true,
        ],
        "inaplazable_change_user_id" => [
            "type" => "INT",
            "unsigned" => true,
            "constraint" => 10,
            "null" => true,
        ],

    ];
    
    public function up()
    {
        $this->forge->addColumn("pedidos", $this->USER_COLUMNS);
    }

    public function down()
    {
        $this->forge->dropColumn("pedidos", array_keys($this->USER_COLUMNS));
        
    }
}
