Lumen migration(数据库协同)

建立迁移文件/新建表文件

php artisan make:migration create_users_table

添加字段

php artisan make:migration add_column_user_type

修改表

php artisan make:migration change_user_table --table=banner

执行迁移文件/其他人建立的文件

php artisan migrate

  

这样便实现多人开发的数据库表同步

接下来看看自动建的migrations表

自增主键id,运行的migration文件名,batch记录第几次运行脚本

如果执行发现新增的表有问题,可以手动删除对应记录,改正migration文件后再运行

参考:https://docs.golaravel.com/docs/5.0/migrations/

https://9iphp.com/web/laravel/laravel-5-migrations.html

http://laravelacademy.org/post/130.html

原文地址:https://www.cnblogs.com/cxscode/p/8371789.html