我在开发模式下在 FuelPHP 1.7.3 上运行以下命令:
php oil g scaffold clients long_name:varchar[50] short_name:varchar[3] --updated-at=updated --created-at=created --deleted-at=deleted --soft-delete
它按预期输出以下内容:
Creating migration: /.../dan/fuel/app/migrations/001_create_clients.php
Creating model: /.../dan/fuel/app/classes/model/client.php
Creating controller: /.../dan/fuel/app/classes/controller/clients.php
Creating view: /.../dan/fuel/app/views/clients/index.php
Creating view: /.../dan/fuel/app/views/clients/view.php
Creating view: /.../dan/fuel/app/views/clients/create.php
Creating view: /.../dan/fuel/app/views/clients/edit.php
Creating view: /.../dan/fuel/app/views/clients/_form.php
但是,当我运行迁移命令时,不会使用自定义创建/更新/删除的列名创建表,并且当您通过前端删除记录时,它会硬删除记录。
软删除功能不适用于脚手架吗?
如果上面的答案是肯定的,那么我应该如何在生成脚手架后添加软删除?