<?php

use Phalcon\Mvc\Model\Migration;

class CommentAttachmentMigration_253 extends Migration
{
    public function up()
    {
        self::$connection->execute('
            CREATE TABLE IF NOT EXISTS "jaga"."comment_attachment" (
                id SERIAL PRIMARY KEY,
                comment_id INTEGER  NOT NULL,               
				filename varchar(255) NOT NULL,               
				filetype varchar(255) NOT NULL,               
                created_at timestamp without time zone DEFAULT now() NOT NULL,
				updated_at timestamp without time zone DEFAULT now() NOT NULL,
				uuid uuid  NOT NULL DEFAULT jaga.uuid_generate_v4()				
            );           
        ');
    }
		
	public function down()
    {
        self::$connection->execute("
            DROP TABLE jaga.comment_attachment
        ");
    }
}
