<commit_before><?php

use yii\db\Migration;
use yii\db\Schema;

class m130524_201442_init extends Migration
{
    public $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';

    public function safeUp()
    {
        $this->execute('SET foreign_key_checks = 0');
        // admin_log
        $this->createTable('{{%admin_log}}', [
            'id' => Schema::TYPE_PK,
            'route' => Schema::TYPE_STRING . "(255) NOT NULL DEFAULT ''",
            'description' => Schema::TYPE_TEXT . " NULL",
            'created_at' => Schema::TYPE_INTEGER . "(10) NOT NULL",
            'user_id' => Schema::TYPE_INTEGER . "(10) NOT NULL DEFAULT '0'",
            'ip' => Schema::TYPE_INTEGER . "(10) NOT NULL DEFAULT '0'",
        ], $this->tableOptions);

// article
        $this->createTable('{{%article}}', [
            'id' => Schema::TYPE_PK,
            'title' => Schema::TYPE_STRING . "(50) NOT NULL COMMENT '标题'",
            'category' => Schema::TYPE_STRING . "(50) NOT NULL COMMENT '分类'",
            'category_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
            'created_at' => Schema::TYPE_INTEGER . "(10) NOT NULL",
            'updated_at' => Schema::TYPE_INTEGER . "(10) NOT NULL",
            'status' => Schema::TYPE_BOOLEAN . " NOT NULL COMMENT '状态'",
            'cover' => Schema::TYPE_STRING . "(255) NULL COMMENT '封面'",
            'comment' => Schema::TYPE_INTEGER . "(11) NOT NULL DEFAULT '0'",
            'up' => Schema::TYPE_INTEGER . "(11) NOT NULL DEFAULT '0'",
            'down' => Schema::TYPE_INTEGER . "(11) NOT NULL DEFAULT '0'",
            'view' => Schema::TYPE_INTEGER . "(11) NOT NULL DEFAULT '0'",
            'is_top' => $this->smallInteger(1)->notNull()->defaultValue(0)->comment('是否置顶'),
            'is_hot' => $this->smallInteger(1)->notNull()->defaultValue(0)->comment('是否热门'),
            'is_best' => $this->smallInteger(1)->notNull()->defaultValue(0)->comment('是否精华'),
            'description' => Schema::TYPE_STRING . "(255) NULL",
            'user_id' => Schema::TYPE_INTEGER . "(11) NOT NULL DEFAULT '0'",
            'source' => Schema::TYPE_STRING . "(255) NOT NULL DEFAULT ''",
            'deleted_at' => Schema::TYPE_INTEGER . "(10)",
            'favourite' => Schema::TYPE_INTEGER . "(11) NOT NULL DEFAULT '0'",
            'published_at' => Schema::TYPE_INTEGER . "(10) NOT NULL DEFAULT '0'",
        ], $this->tableOptions);
        $this->createIndex('index_published_at', '{{%article}}', 'published_at');
// article_data
        $this->createTable('{{%article_data}}', [
            'id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
            'content' => Schema::TYPE_TEXT . " NOT NULL",
            'markdown' => $this->smallInteger(1)->notNull()->defaultValue(0)->comment('是否markdown格式'),
            'PRIMARY KEY (id)',
        ], $this->tableOptions);

// article_tag
        $this->createTable('{{%article_tag}}', [
            'article_id' => Schema::TYPE_INTEGER . "(10) NOT NULL",
            'tag_id' => Schema::TYPE_INTEGER . "(10) NOT NULL",
        ], $this->tableOptions);
// meta
        $this->createTable('{{%meta}}', [
            'id' => $this->primaryKey(),
            'title' => $this->string(128),
            'keywords' => $this->string(128),
            'description' => $this->string(128),
            'type' => $this->string(128),
            'type_id' => $this->integer()
        ], $this->tableOptions);
// auth
        $this->createTable('{{%auth}}', [
            'id' => Schema::TYPE_PK,
            'user_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
            'source' => Schema::TYPE_STRING . "(255) NOT NULL",
            'source_id' => Schema::TYPE_STRING . "(255) NOT NULL",
        ], $this->tableOptions);

// category
        $this->createTable('{{%category}}', [
            'id' => Schema::TYPE_PK,
            'title' => Schema::TYPE_STRING . "(50) NOT NULL COMMENT '名字'",
            'pid' => Schema::TYPE_INTEGER . "(11) NOT NULL DEFAULT '0' COMMENT '父id'",
            'created_at' => Schema::TYPE_INTEGER . "(10) NOT NULL",
            'updated_at' => Schema::TYPE_INTEGER . "(10) NOT NULL",
            'slug' => Schema::TYPE_STRING . "(20) NOT NULL",
            'description' => Schema::TYPE_STRING . "(1000) NOT NULL DEFAULT ''",
            'article' => Schema::TYPE_INTEGER . "(10) NOT NULL DEFAULT '0'",
            'sort' => Schema::TYPE_BOOLEAN . " NOT NULL DEFAULT '0'",
            'allow_publish' => $this->smallInteger(1)->defaultValue('1')->comment('是否允许发布内容')
        ], $this->tableOptions);

// comment
        $this->createTable('{{%comment}}', [
            'id' => Schema::TYPE_PK,
            'user_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
            'type_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
            'content' => Schema::TYPE_TEXT . " NOT NULL COMMENT '内容'",
            'parent_id' => Schema::TYPE_INTEGER . "(11) NOT NULL DEFAULT '0'",
            'reply_uid' => $this->integer(11)->defaultValue('0'),
            'up' => Schema::TYPE_INTEGER . "(1) NOT NULL DEFAULT '0'",
            'down' => Schema::TYPE_INTEGER . "(1) NOT NULL DEFAULT '0'",
            'is_top' => Schema::TYPE_SMALLINT . "(1) NOT NULL DEFAULT '0'",
            'type' => Schema::TYPE_STRING . "(20) NOT NULL",
            'created_at' => Schema::TYPE_INTEGER . "(10) NOT NULL",
            'updated_at' => Schema::TYPE_INTEGER . "(10) NOT NULL",
        ], $this->tableOptions);
        $this->createIndex('type', '{{%comment}}', ['type', 'type_id']);
// comment_info
        $this->createTable('{{%comment_info}}', [
            'id' => Schema::TYPE_PK,
            'type' => $this->string(80)->notNull(),
            'type_id' => $this->integer(11)->notNull(),
            'status' => $this->boolean()->notNull()->defaultValue(1),
            'total' => $this->integer(11)->notNull()
        ], $this->tableOptions);
        $this->createIndex('type', '{{%comment_info}}', ['type', 'type_id']);
// favourite
        $this->createTable('{{%favourite}}', [
            'id' => Schema::TYPE_PK,
            'user_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",<commit_msg>comment表缺少status字段<commit_after><?php

use yii\db\Migration;
use yii\db\Schema;

class m130524_201442_init extends Migration
{
    public $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';

    public function safeUp()
    {
        $this->execute('SET foreign_key_checks = 0');
        // admin_log
        $this->createTable('{{%admin_log}}', [
            'id' => Schema::TYPE_PK,
            'route' => Schema::TYPE_STRING . "(255) NOT NULL DEFAULT ''",
            'description' => Schema::TYPE_TEXT . " NULL",
            'created_at' => Schema::TYPE_INTEGER . "(10) NOT NULL",
            'user_id' => Schema::TYPE_INTEGER . "(10) NOT NULL DEFAULT '0'",
            'ip' => Schema::TYPE_INTEGER . "(10) NOT NULL DEFAULT '0'",
        ], $this->tableOptions);

// article
        $this->createTable('{{%article}}', [
            'id' => Schema::TYPE_PK,
            'title' => Schema::TYPE_STRING . "(50) NOT NULL COMMENT '标题'",
            'category' => Schema::TYPE_STRING . "(50) NOT NULL COMMENT '分类'",
            'category_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
            'created_at' => Schema::TYPE_INTEGER . "(10) NOT NULL",
            'updated_at' => Schema::TYPE_INTEGER . "(10) NOT NULL",
            'status' => Schema::TYPE_BOOLEAN . " NOT NULL COMMENT '状态'",
            'cover' => Schema::TYPE_STRING . "(255) NULL COMMENT '封面'",
            'comment' => Schema::TYPE_INTEGER . "(11) NOT NULL DEFAULT '0'",
            'up' => Schema::TYPE_INTEGER . "(11) NOT NULL DEFAULT '0'",
            'down' => Schema::TYPE_INTEGER . "(11) NOT NULL DEFAULT '0'",
            'view' => Schema::TYPE_INTEGER . "(11) NOT NULL DEFAULT '0'",
            'is_top' => $this->smallInteger(1)->notNull()->defaultValue(0)->comment('是否置顶'),
            'is_hot' => $this->smallInteger(1)->notNull()->defaultValue(0)->comment('是否热门'),
            'is_best' => $this->smallInteger(1)->notNull()->defaultValue(0)->comment('是否精华'),
            'description' => Schema::TYPE_STRING . "(255) NULL",
            'user_id' => Schema::TYPE_INTEGER . "(11) NOT NULL DEFAULT '0'",
            'source' => Schema::TYPE_STRING . "(255) NOT NULL DEFAULT ''",
            'deleted_at' => Schema::TYPE_INTEGER . "(10)",
            'favourite' => Schema::TYPE_INTEGER . "(11) NOT NULL DEFAULT '0'",
            'published_at' => Schema::TYPE_INTEGER . "(10) NOT NULL DEFAULT '0'",
        ], $this->tableOptions);
        $this->createIndex('index_published_at', '{{%article}}', 'published_at');
// article_data
        $this->createTable('{{%article_data}}', [
            'id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
            'content' => Schema::TYPE_TEXT . " NOT NULL",
            'markdown' => $this->smallInteger(1)->notNull()->defaultValue(0)->comment('是否markdown格式'),
            'PRIMARY KEY (id)',
        ], $this->tableOptions);

// article_tag
        $this->createTable('{{%article_tag}}', [
            'article_id' => Schema::TYPE_INTEGER . "(10) NOT NULL",
            'tag_id' => Schema::TYPE_INTEGER . "(10) NOT NULL",
        ], $this->tableOptions);
// meta
        $this->createTable('{{%meta}}', [
            'id' => $this->primaryKey(),
            'title' => $this->string(128),
            'keywords' => $this->string(128),
            'description' => $this->string(128),
            'type' => $this->string(128),
            'type_id' => $this->integer()
        ], $this->tableOptions);
// auth
        $this->createTable('{{%auth}}', [
            'id' => Schema::TYPE_PK,
            'user_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
            'source' => Schema::TYPE_STRING . "(255) NOT NULL",
            'source_id' => Schema::TYPE_STRING . "(255) NOT NULL",
        ], $this->tableOptions);

// category
        $this->createTable('{{%category}}', [
            'id' => Schema::TYPE_PK,
            'title' => Schema::TYPE_STRING . "(50) NOT NULL COMMENT '名字'",
            'pid' => Schema::TYPE_INTEGER . "(11) NOT NULL DEFAULT '0' COMMENT '父id'",
            'created_at' => Schema::TYPE_INTEGER . "(10) NOT NULL",
            'updated_at' => Schema::TYPE_INTEGER . "(10) NOT NULL",
            'slug' => Schema::TYPE_STRING . "(20) NOT NULL",
            'description' => Schema::TYPE_STRING . "(1000) NOT NULL DEFAULT ''",
            'article' => Schema::TYPE_INTEGER . "(10) NOT NULL DEFAULT '0'",
            'sort' => Schema::TYPE_BOOLEAN . " NOT NULL DEFAULT '0'",
            'allow_publish' => $this->smallInteger(1)->defaultValue('1')->comment('是否允许发布内容')
        ], $this->tableOptions);

// comment
        $this->createTable('{{%comment}}', [
            'id' => Schema::TYPE_PK,
            'user_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
            'type_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
            'content' => Schema::TYPE_TEXT . " NOT NULL COMMENT '内容'",
            'parent_id' => Schema::TYPE_INTEGER . "(11) NOT NULL DEFAULT '0'",
            'reply_uid' => $this->integer(11)->defaultValue('0'),
            'up' => Schema::TYPE_INTEGER . "(1) NOT NULL DEFAULT '0'",
            'down' => Schema::TYPE_INTEGER . "(1) NOT NULL DEFAULT '0'",
            'is_top' => Schema::TYPE_SMALLINT . "(1) NOT NULL DEFAULT '0'",
            'type' => Schema::TYPE_STRING . "(20) NOT NULL",
            'status' => Schema::TYPE_SMALLINT . "(1) NOT NULL DEFAULT '0'",
            'created_at' => Schema::TYPE_INTEGER . "(10) NOT NULL",
            'updated_at' => Schema::TYPE_INTEGER . "(10) NOT NULL",
        ], $this->tableOptions);
        $this->createIndex('type', '{{%comment}}', ['type', 'type_id']);
// comment_info
        $this->createTable('{{%comment_info}}', [
            'id' => Schema::TYPE_PK,
            'type' => $this->string(80)->notNull(),
            'type_id' => $this->integer(11)->notNull(),
            'status' => $this->boolean()->notNull()->defaultValue(1),
            'total' => $this->integer(11)->notNull()
        ], $this->tableOptions);
        $this->createIndex('type', '{{%comment_info}}', ['type', 'type_id']);
// favourite
        $this->createTable('{{%favourite}}', [
            'id' => Schema::TYPE_PK,
            'user_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
{'fraction_non_alphanumeric': 0.20079345801959356, 'fraction_numerical': 0.025099182252449195, 'mean_word_length': 2.4942008486562943, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 264, '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': '2390851', 'n_tokens_mistral': 3950, 'n_tokens_neox': 3901, 'n_words': 788}