Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it safe to seed production databases with DoctrineFixturesBundle?

My application needs some rows to be present in some tables to function properly when it is deployed. However, I'm not sure if the DoctrineFixturesBundle is written to be run on a production server. It works perfectly fine on my development machine, but is it safe enough to use on production?

like image 307
Parham Doustdar Avatar asked Mar 28 '15 06:03

Parham Doustdar


1 Answers

Personal experience

I have integrated the bundle alongside doctrine/doctrine-migrations-bundle into the (continous) deployment process of several symfony2 applications since end of 2011.

I never ran into any problems with the fixtures-bundle.

I have to admit that the migrations-bundle occasionally gave me some headaches - but it meanwhile feels very mature and stable subjectively.

General information

doctrine/data-fixtures was introduced in mid 2010.

doctrine/doctrine-fixtures-bundle (the bundle to integrate with symfony2 projects) exists since mid 2011.

It is one of the top 20 most used bundles according to this survey by SensioLabs.

capifony - the widely used deployment tool for symfony2 applications - has builtin support for loading fixtures with the bundle.

Test coverage

doctrine/data-fixtures has a good test coverage.

The bundle itself currently doesn't provide any tests ... but the only thing it provides is a very simple command. Have a look at the code.

Conclusion

I'd say the bundle is definitely safe for production deployments as I'm doing so for 3+ years by now.

With >2 million installs of doctrine/doctrine-fixtures-bundle via composer ... I'm definitely not the only one thinking like that.

like image 80
Nicolai Fröhlich Avatar answered Nov 15 '22 06:11

Nicolai Fröhlich