<?php

use Phalcon\Mvc\Model\Migration;

class LogSekolahMigration_342 extends Migration
{
    public function up()
    {
        $this->down();

        self::$connection->execute('
            CREATE TABLE "jaga"."log_sekolah_errors"
            (
                "id" serial NOT NULL,
                "npsn" character varying NOT NULL,
                "last_error_message" character varying,
                "error_count" integer,
                "created_at" timestamp(6) without time zone NOT NULL DEFAULT now(),
                "last_error_at" timestamp(6) without time zone NOT NULL DEFAULT now(),
                PRIMARY KEY (id)
            )
            WITH (
                OIDS = FALSE
            );
        ');
    }

    public function down()
    {

        self::$connection->execute('
            DROP TABLE IF EXISTS "jaga"."log_sekolah_errors";
        ');
    }
}
