swoft 学习之 踩坑笔记(三)

1.数据库 实例自动生成

root@7fc3c9aaefa4:/var/www/swoft# php bin/swoft entity:gen table -h

Usage:
  bin/swoft entity:gen [arguments ...] [options ...]

Global Options:
      --debug      Setting the application runtime debug level(0 - 4)
      --no-color   Disable color/ANSI for message output
  -h, --help       Display help message for application or command
  -V, --version    Display application version information

Arguments:
  table STRING   Database table names

Options:
  --exclude STRING           Expect generate database table entity, alias is 'exc'
  --field_prefix STRING      Database field prefix ,alias is 'fp'
  --path STRING              Generate entity file path (defaults: @app/Model/Entity)
  --pool STRING              Choose default database pool (defaults: db.pool)
  --remove_prefix STRING     Remove table prefix ,alias is 'rp'
  --table STRING             Database table names
  --table_prefix STRING      Like match database table prefix, alias is 'tp'
  --td STRING                Generate entity template path (defaults: @devtool/devtool/resource/template)
  -y STRING                  Auto generate

该命令可以一次生成多个实例,通过对你数据库中 table 的信息读取,然后自动生成一个个实例

生成/更新 指定的 table

其中注意一个地方 就是 参数 table names 之间使用逗号 ‘,’ 隔开

php bin/swoft entity:gen table= table1,table2,table3,...
生成所有的实例
php bin/swoft entity:gen -y
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值