/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('free_resources', function (Blueprint $table) {
DB::statement("ALTER TABLE free_resources CHANGE COLUMN type type VARCHAR(255) DEFAULT '' comment '资料类型' ");
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('free_resources', function (Blueprint $table) {
$table->dropColumn('type');
});
}
本文介绍了一次数据库迁移过程中对free_resources表的结构调整,具体包括将type字段从原有设置改为VARCHAR类型,并设定默认值及注释。同时,提供了回滚操作的方法,即删除type字段。
401

被折叠的 条评论
为什么被折叠?



