]> rtime.felk.cvut.cz Git - linux-conf-perf.git/blobdiff - Makefile
Implement database using Django framework
[linux-conf-perf.git] / Makefile
index d511ff1b76aa044bf1a8e02858748decc484a049..76babfb829deeb2ed3e4061f994ee661a4f87204 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -21,7 +21,7 @@ help:
 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:
@@ -50,11 +50,13 @@ init: initialize
 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"
@@ -105,11 +107,11 @@ clean_measure:
        $(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"