From dc4f27c84c3142a731284857e68a2b644b833656 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Fri, 19 Mar 2021 20:36:57 +0100 Subject: [PATCH] [constellation] Make migrations in the deployment while first version is not released Signed-off-by: Yohann D'ANELLO --- roles/constellation-front/tasks/main.yml | 10 ---------- roles/constellation/tasks/main.yml | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/roles/constellation-front/tasks/main.yml b/roles/constellation-front/tasks/main.yml index 03d700dc..e753b595 100644 --- a/roles/constellation-front/tasks/main.yml +++ b/roles/constellation-front/tasks/main.yml @@ -33,13 +33,3 @@ django_manage: command: collectstatic project_path: "/var/local/constellation" - -- name: Migrate database - django_manage: - command: migrate - project_path: "/var/local/constellation" - -- name: Load initial data - django_manage: - command: loaddata initial - project_path: "/var/local/constellation" diff --git a/roles/constellation/tasks/main.yml b/roles/constellation/tasks/main.yml index 38810fdd..3023bfc2 100644 --- a/roles/constellation/tasks/main.yml +++ b/roles/constellation/tasks/main.yml @@ -70,6 +70,22 @@ command: compilemessages project_path: "/var/local/constellation" +# In the future, migrations will be included in the repository. +- name: Make Django migrations + django_manage: + command: makemigrations + project_path: "/var/local/constellation" + +- name: Migrate database + django_manage: + command: migrate + project_path: "/var/local/constellation" + +- name: Load initial data + django_manage: + command: loaddata initial + project_path: "/var/local/constellation" + - name: Indicate constellation in motd template: src: update-motd.d/05-service.j2