<?php

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

/**
 * Class RolesMigration_211
 */
class StranasSurveyAnswerAttachmentMigration_163 extends Migration
{
    /**
     * Run the migrations
     *
     * @return void
     */
    public function up()
    {
        self::$connection->execute('
        CREATE TABLE jaga.stranas_survey_answer_attachment (
            id serial PRIMARY KEY,
            id_answer int NOT NULL,
            uuid varchar(100) NOT NULL,
            filename varchar(200) NOT NULL,
            tipe int DEFAULT 0,
            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.stranas_survey_answer_attachment
        ');
    }
}
