我想知道如何在生产环境中使用Doctrine
灯具。例如,当我想预定义一组固定的权限或超级用户等时。
Doctrine documentation states:
Fixtures用于将“假”数据集加载到数据库中,然后可以在开发应用程序时用于测试或帮助您提供一些有趣的数据。
因此,我不想使用自己的灯具,因为它会违背它的概念。
有任何想法吗?
你也可以使用带有--append
选项的灯具,它不会清除数据库。
Documentation。
php bin/console doctrine:fixtures:load --append --fixtures=/path/to/production/fixtures1 --fixtures=/path/to/production/fixtures2
您只需将其添加到命令行:
--env = PROD