Skip to content

Conversation

ThePeterMick
Copy link
Contributor

According to https://symfony.com/doc/current/bundles/DoctrineFixturesBundle/index.html this bundle "should" be only enabled in dev and test - any reason why symfony/demo needs in other envs?

@javiereguiluz
Copy link
Member

@ptrm04 thanks for this. However, it looks like we need this bundle in production to create the original application data. In previous Symfony versions, where we controlled the bundle list manually, we added a comment explaining this:

new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(), // used for initial population of non-SQLite databases in production envs

But now we have the config/bundles.php file that is managed by Symfony and where we can't put any comment. So, I see two possible solutions:

  • Do this change anyway and forget about data fixtures in production because this is not a real app and the way we distribute this app it will always work;
  • Don't do this change but add some comment somewhere explaining this.

@bocharsky-bw
Copy link
Contributor

I'm leaning toward the 1st, probably we don't need fixtures in production since we committed populated SQLite DB to the repo which is enough on our side. If someone prefers to run it on another SQL DB - they need to perform more steps anyway like changing default DB credentials at least. So one more step to load fixtures manually is not a problem in my opinion

@phpeek
Copy link
Contributor

phpeek commented Dec 27, 2017

I'm with @bocharsky-bw.

We need to assume people are looking at symfony/demo as a way they should develop their own apps. We should not encourage people to have DoctrineFixturesBundle registered with production environment. Running doctrine:fixtures:load on production database by mistake could end up with a huge headache. :)

@javiereguiluz
Copy link
Member

Let's merge this ... but we'll do that in #805, which is the same as this PR but without conflicts. Thanks!

javiereguiluz added a commit that referenced this pull request May 25, 2018
…reguiluz)

This PR was merged into the master branch.

Discussion
----------

Moved Doctrine Fixtures bundle to dev and test only

This is the same PR as #738 created by @ptrm04. The original PR has conflicts in `composer.*` files and those are always hard to solve.

Commits
-------

f46f849 Moved Doctrine Fixtures bundle to dev and test only
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants