From e09e2e2caff67ce5e996c59e8f94fef69b4faed2 Mon Sep 17 00:00:00 2001 From: xairi Date: Wed, 17 Apr 2019 17:43:29 -0500 Subject: [PATCH] =?UTF-8?q?Added=20command=20to=20migrate=20the=20database?= =?UTF-8?q?=20for=20django=20p=C5=95ojects?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tasks/post_install.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tasks/post_install.yaml b/tasks/post_install.yaml index 43ce15e..082241b 100644 --- a/tasks/post_install.yaml +++ b/tasks/post_install.yaml @@ -33,3 +33,13 @@ - python_pyenv_file_requeriments is defined tags: - deploy + +- name: Apply migrations + become_user: "{{ python_pyenv_owner }}" + shell: ". {{ _python_path_file_pyenvrunrc }} && python manage.py migrate" + when: + - python_pyenv_virtualenvs is defined + - python_pyenv_install + tags: + - migrations +