composer require echodao\framework-tool
在模型加入注释
/**
* Demo Class
* @var string connection
* @var string table demo
* @var string options {"id":false,"primary_key":["demo_id","user_id"],"engine":"MyISAM","collation":"utf8_general_ci"}
* @var string columns {"name":"demo_id","type":"integer"}
* @var string columns {"name":"user_id","type":"integer"}
* @var string columns {"name":"name","type":"string","options":{"limit":50,"comment":"标题"}}
* @var string columns {"name":"status","type":"boolean","options":{"limit":1},"comment":"状态"}
* @var string columns {"name":"create_time","type":"integer","options":{"null":true,"comment":"添加时间"}}
* @var string indexes
* @var string foreignkeys {}
*/
执行命令 php think migrate:model 更新所有模型表
- 参数 --model app\\model\\Demo 指定模型更新表
- 参数 --conn app\\model\\Demo 指定数据库连接
QQ群: 67761412