HELP+="psql - Launch PostgreSQL interactive terminal.\n"
.PHONY: psql
psql:
- PGPASSWORD="$(CONF_DB_PASSWORD)" psql -d "$(CONF_DB_DATABASE)" -h "$(CONF_DB_HOST)" -p "$(CONF_DB_PORT)"
+ psql -d "$(CONF_DB_DATABASE)"
.PHONY: mbuildroot
mbuildroot:
initialize: all
scripts/initialize.py
-HELP+="initdb - Initialize database.\n"
-.PHONY: initdb initialize_database
+HELP+="dbmigrate - Migrate database.\n"
+.PHONY: initdb initialize_database dbmigrate
initdb: initialize_database
-initialize_database:
- PGPASSWORD="$(CONF_DB_PASSWORD)" psql -d "$(CONF_DB_DATABASE)" -h "$(CONF_DB_HOST)" -p "$(CONF_DB_PORT)" -f scripts/databaseinit.sql
+initialize_database: dbmigrate
+dbmigrate:
+ ./scripts/database/manage.py makemigrations
+ ./scripts/database/manage.py migrate
HELP+="test - Executes boot and benchmark test. You should use this before\n"
HELP+=" target run. This target is for testing if initial kernel\n"
$(RM) -r result
$(RM) $(CONF_DOT_CONFIG)
-HELP+="clean_database - Drop all tables in database.\n"
+HELP+="clean_database - Drop all entries in database.\n"
.PHONY: cleandb clean_database
cleandb: clean_database
clean_database:
- PGPASSWORD="$(CONF_DB_PASSWORD)" psql -d "$(CONF_DB_DATABASE)" -h "$(CONF_DB_HOST)" -p "$(CONF_DB_PORT)" -f scripts/databaseclean.sql
+ ./scripts/database/manage.py flush
HELP+="distclean - Cleans all configurations and generated files.\n"
HELP+=" Including linux and buildroot.\n"