<?php

use yii\db\Migration;

/**
 * Class m220929_071856_add_image_to_topic
 */
class m220929_071856_add_image_to_topic extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->createTable("{{%topic_images}}",[
            "id"=>$this->primaryKey(),
            "topic_id"=>$this->integer(),
            "uploaded_at"=>$this->dateTime(),
            "alt"=>$this->text(),
            "ext"=>$this->string(),
        ]);
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        echo "m220929_071856_add_image_to_topic cannot be reverted.\n";

        return false;
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m220929_071856_add_image_to_topic cannot be reverted.\n";

        return false;
    }
    */
}
