<?php

use Phalcon\Mvc\Model\Migration;

class KorwilAnggaranMigration_240 extends Migration
{
    public function up()
    {
        self::$connection->execute('
            CREATE TABLE IF NOT EXISTS "jaga"."korwil_anggaran_template" (
                id serial primary key,
                name varchar(255) NOT NULL,
                template json,
                id_sub_indikator int,
                created_at timestamp(6) DEFAULT now(),
                updated_at timestamp(6) DEFAULT now(),
                deleted_at timestamp(6),
                created_by int,
                updated_by int
            );

            CREATE TABLE IF NOT EXISTS "jaga"."korwil_anggaran" (
                id serial primary key,
                id_template int,
                id_instansi int,
                id_periode int,
                anggaran json, 
                verified_at timestamp(6),
                verified_by int,
                verified_message varchar(255),
                verified_status int, 
                created_at timestamp(6) DEFAULT now(),
                updated_at timestamp(6) DEFAULT now(),
                deleted_at timestamp(6),
                created_by int,
                updated_by int
            );
        ');
    }
}
