<?php

use Phalcon\Db\Column;
use Phalcon\Db\Index;
use Phalcon\Db\Reference;
use Phalcon\Mvc\Model\Migration;

/**
 * Class RolesMigration_211
 */
class AttachmentsMigration_164 extends Migration
{
    /**
     * Run the migrations
     *
     * @return void
     */
    public function up()
    {
        self::$connection->execute('
        CREATE TABLE jaga.attachments (
            id serial PRIMARY KEY,
            tipe int DEFAULT 0,
            uuid varchar(100) NOT NULL,
            filename varchar(200) NOT NULL,
            keterangan text,
            metadata int,
            metadata2 int,
            metadata3 int,
            created_at timestamp(6) DEFAULT now(),
            updated_at timestamp(6) DEFAULT now(),
            deleted_at timestamp(6),
            created_by int,
            updated_by int
        )');
    }

    /**
     * Reverse the migrations
     *
     * @return void
     */
    public function down()
    {
        self::$connection->execute('
            DROP IF EXIST TABLE jaga.attachments
        ');
    }
}
