fix migration file error

This commit is contained in:
xiaomlove
2021-06-09 17:09:16 +08:00
parent c771ff9ef1
commit 36b8e9a3db
7 changed files with 9 additions and 100 deletions
@@ -21,12 +21,13 @@ class CreatePostsTable extends Migration
$table->unsignedMediumInteger('topicid')->default(0);
$table->unsignedMediumInteger('userid')->default(0)->index('userid');
$table->dateTime('added')->nullable()->index('added');
$table->text('body')->nullable()->index('body');
$table->text('body')->nullable();
$table->text('ori_body')->nullable();
$table->unsignedMediumInteger('editedby')->default(0);
$table->dateTime('editdate')->nullable();
$table->index(['topicid', 'id'], 'topicid_id');
});
\Illuminate\Support\Facades\DB::statement('alter table posts add fulltext body(body)');
}
/**
@@ -20,10 +20,11 @@ class CreateTorrentsCustomFieldValuesTable extends Migration
$table->integer('id', true);
$table->integer('torrent_id')->default(0)->index('idx_torrent_id');
$table->integer('custom_field_id')->default(0)->index('idx_field_id');
$table->mediumText('custom_field_value')->nullable()->index('idx_field_value');
$table->mediumText('custom_field_value')->nullable();
$table->dateTime('created_at');
$table->dateTime('updated_at');
});
\Illuminate\Support\Facades\DB::statement('alter table torrents_custom_field_values add index(custom_field_value(191))');
}
/**
@@ -18,7 +18,6 @@ class CreateTorrentsTable extends Migration
}
Schema::create('torrents', function (Blueprint $table) {
$table->mediumIncrements('id');
$table->binary('info_hash')->unique('info_hash');
$table->string('name')->default('')->index('name');
$table->string('filename')->default('');
$table->string('save_as')->default('');
@@ -65,6 +64,8 @@ class CreateTorrentsTable extends Migration
$table->index(['category', 'visible', 'banned'], 'category_visible_banned');
$table->index(['visible', 'banned', 'pos_state', 'id'], 'visible_banned_pos_id');
});
$sql = 'alter table torrents add column `info_hash` binary(20) NOT NULL after id, add unique info_hash(`info_hash`)';
\Illuminate\Support\Facades\DB::statement($sql);
}
/**