Mentions légales du service

Skip to content

refactor django db init

BAIRE Anthony requested to merge local-migrations into django

This PR removes all the existing migrations from allgo/main/migrations (which were not up-to-date) and generate them on-the-fly instead.

  • .gitignore is configured to ignore all migrations scrips
  • container_init calls makemigrations before creating the db This is a temporary measure until we go to production. Before the first production deployment we will have to revert babd35f4 and run makemigrations to generate the initial migration.

Also with this PR, the django db is no longer initialised from the rails db (the migrate.sh is no longer called at container init). The db is created from scratch instead and seeded with default values (python3 manage.py db_seed).

The db_seed command creates default values (required for allgo to work):

  • initial docker OS list (debian, centos, fedora, ubuntu)
  • default job queue (named 'default')
  • the 'inria' Group (seems to be hardcoded in the sources)

Additionally, in development mode, it creates (and enables) 3 user accounts (all with the 'allgo' password):

  • admin@localhost which is superuser
  • devel@localhost which own a webapp named 'sleep'
  • guest@localhost

Merge request reports

Loading