<commit_before><?php

use yii\db\Migration;

class m161221_095231_image extends Migration
{
    public function up()
    {
        $tableOptions = null;
        if ($this->db->driverName === 'mysql') {
            $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
        }
        $this->createTable('{{%image}}', [
            'id' => $this->primaryKey(),
            'name' => $this->string()->notNull()->unique(),
            'path' => $this->string()->notNull()->unique(),
            'video_id' => $this->integer() -> notNull(),
            'section_id' => $this->integer() -> notNull(),
            'created_at' => $this->integer(),
            'created_by' => $this->integer(),
            'updated_at' => $this->integer(),
            'updated_by' => $this->integer(),
        ], $tableOptions);
    }

    public function down()
    {
        $this->dropTable('{{%image}}');
    }

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }
<commit_msg>Проектирование БД и создание миграций.<commit_after><?php

use yii\db\Migration;

class m161221_095231_image extends Migration
{
    public function up()
    {
        $tableOptions = null;
        if ($this->db->driverName === 'mysql') {
            $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
        }
        $this->createTable('{{%image}}', [
            'id' => $this->primaryKey(),
            'name' => $this->string()->notNull()->unique(),
            'path' => $this->string()->notNull()->unique(),
            'video_id' => $this->integer() -> notNull(),
            'created_at' => $this->integer(),
            'created_by' => $this->integer(),
            'updated_at' => $this->integer(),
            'updated_by' => $this->integer(),
        ], $tableOptions);
    }

    public function down()
    {
        $this->dropTable('{{%image}}');
    }

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

{'fraction_non_alphanumeric': 0.18186226964112512, 'fraction_numerical': 0.013579049466537343, 'mean_word_length': 2.208398133748056, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 56, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7578571', 'n_tokens_mistral': 642, 'n_tokens_neox': 627, 'n_words': 121}