数据库
数据库追加字段
命令:
php artisan make:migration add_thumb_field_to_post
用法:
public function up()
{
Schema::table('post', function (Blueprint $table) {
$table->string('thumb')->nullable()->comment('缩略图')->after('level_id');
});
}
public function down() {
Schema::table('post', function (Blueprint $table) {
$table->dropColumn('thumb');
});
}
执行生成数据表
php artisan migrate
撤销上次生成的数据表
php artisan migrate:rollback