Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doctrine integration #57

Open
sagikazarmark opened this issue Mar 18, 2016 · 3 comments
Open

Doctrine integration #57

sagikazarmark opened this issue Mar 18, 2016 · 3 comments

Comments

@sagikazarmark
Copy link
Contributor

I haven't found any previous discussions about this topic, so I start one here:

One thing that is missing from this gem (and we had it in capifony) is doctrine integration.

I have this basic list of doctrine tasks:

namespace :doctrine do
    namespace :schema do
        desc "Drop doctrine schema"
        task :drop do
            on roles(:app) do
                invoke "symfony:console", "doctrine:schema:drop", "--force"
            end
        end

        desc "Create doctrine schema"
        task :create do
            on roles(:app) do
                invoke "symfony:console", "doctrine:schema:create"
            end
        end
    end

    namespace :migrations do
        desc "Execute doctrine migrations"
        task :migrate do
            on roles(:app) do
                invoke "symfony:console", "doctrine:migrations:migrate", "--no-interaction"
            end
        end
    end

    namespace :fixtures do
        desc "Load doctrine fixtures"
        task :load do
            on roles(:app) do
                invoke "symfony:console", "doctrine:fixtures:load", "--no-interaction"
            end
        end
    end
end

I am aware of https://github.com/glooby/capistrano-symfony-doctrine, but I think it would be better to have it in the symfony package. Also, I propose the following improvements:

  • Support different entity managers
  • Roles and environment should be defined by the user when using the specific tasks in the configuration

What do you think?

@peterjmit
Copy link
Contributor

hi @sagikazarmark.

I would rather keep this logic in the separate library, I would generally not recommend running anything other than migrations:migrate (and perhaps database:create) in a production environment. These commands end up being quite specific to each team's workflow.

If people are finding the doctrine library useful then perhaps we can add a link to the README?

@sagikazarmark
Copy link
Contributor Author

Well, to be honest I had doubts as well about this.

One point though: doctrine commands, like drop, fixtures might make sense in dev env.

Let's see if I can come up with something.

@Nyholm
Copy link
Collaborator

Nyholm commented Sep 6, 2018

I will add the migrate command to the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants