1.生成一个新的migration文件
php artisan make:migration xxx
创建一个名字为时间+xxx的数据迁移文件
2.设计表
Schema::create(‘categorys’, function (Blueprint table)xxxx);//创建表 table->engine = ‘InnoDB’; //设置表的存储引擎为Innodb
table−>increments(‘id′);//设置表的主键id table->string(‘name’); //设置字符串字段
$table->integer(‘sort’); //设置整形字段
3.生成数据库
php artisan migrate