aboutsummaryrefslogtreecommitdiff
path: root/dbinit/makefile
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-04-09 13:12:55 +0200
committerlonkaars <loek@pipeframe.xyz>2023-04-09 13:12:55 +0200
commitc804c2c158ea5b785311d0f453e717b33208b866 (patch)
treefa4d7131b50c42d162ca5b3ea67407c6867f3a00 /dbinit/makefile
parent26bd867457693479582669479959b7b96cab16e8 (diff)
update schema
Diffstat (limited to 'dbinit/makefile')
-rw-r--r--dbinit/makefile16
1 files changed, 6 insertions, 10 deletions
diff --git a/dbinit/makefile b/dbinit/makefile
index f2dcd75..d20ebd2 100644
--- a/dbinit/makefile
+++ b/dbinit/makefile
@@ -2,35 +2,31 @@ SQL = mysql
USER = $(shell id -un)
HOST = localhost
-.PHONY: clean permissions init data procedures full
+.PHONY: clean permissions base data full
all: full
# delete old tables and create new tables
-init: base.sql
+base: base.sql
$(SQL) < $<
# fill tables with data
data: data.sql
$(SQL) < $<
-# add procedures/sql functions
-procedures: procedures.sql
- $(SQL) < $<
-
-# do all of the above in one go
+# do everything
full: full.sql
$(SQL) < $<
base.sql: reset.sql init.sql
cat $^ > $@
-full.sql: reset.sql init.sql demo.sql views.sql functions.sql procedures.sql triggers.sql
- cat $^ > $@
-
data.sql:
./import.py > $@
+full.sql: base.sql data.sql views.sql functions.sql procedures.sql triggers.sql update.sql
+ cat $^ > $@
+
# grant all database permissions (development only)
permissions:
echo "grant all privileges on formula1.* to '$(USER)'@'$(HOST)';" | sudo $(SQL)