comphppuebla / dbal-fixtures
使用 Doctrine DBAL 进行 fixtures 管理
4.1.1
2022-01-27 03:12 UTC
Requires
- php: >=7.1
- doctrine/dbal: ^2.5 | ^3.3
- fakerphp/faker: ^1.12
- symfony/console: ^4.0 | ^5.0 | ^6.0
- symfony/yaml: ^4.0 | ^5.0 | ^6.0
Requires (Dev)
- phpunit/phpunit: ^6.0
README
使用 YAML 文件进行 fixtures 管理。支持:外键引用和生成假数据。
安装
使用 composer 安装此包
$ composer require comphppuebla/dbal-fixtures
文档
以下 yml
文件将使用由 Faker 生成的随机值,向 stations
表插入 3 行数据,适用于所有列
stations: station_[1..3]: name: "${company}" address_line_1: "${streetAddress}" location: "${city}" coordinates: "`PointFromText('POINT(${latitude} ${longitude})')`" created_at: "${date('Y-m-d H:i:s', 'yesterday')}" last_updated_at: "${date('Y-m-d H:i:s')}"
请访问文档页面获取更多详细信息。
贡献
有关如何为此包做出贡献的信息,请参阅CONTRIBUTING。
许可证
在MIT 许可证下发布。