迁移:创建数据表和删除数据表的操作; * 迁移文件的位置:database/migrations *创建迁移文件:php artisan make:migration 迁移文件名 php artisan make:migration create_paper_table //创建表 *编写迁移文件:
//创建表publicfunction up() { Schema::create(‘paper’, function (Blueprint KaTeX parse error: Expected '}', got 'EOF' at end of input: table) {//table->列类型方法(字段名,[长度/值范围])->列修饰方法();$table->bigIncrements(‘id’); $table->timestamps(); }); }//删除表publicfunction down() { Schema::dropIfExists(‘paper’); }