diff --git a/sql/Makefile b/sql/Makefile index 2c16978..ab596ae 100644 --- a/sql/Makefile +++ b/sql/Makefile @@ -1,42 +1,42 @@ # Depends: postgresql-client, postgresql-autodoc DBNAME = softwareheritage-archiver-dev DOCDIR = autodoc -SQL_INIT = ../../swh-storage/sql/swh-init.sql +SQL_INIT = swh-init.sql SQL_SCHEMA = swh-archiver-schema.sql SQL_FUNC = swh-archiver-func.sql SQL_DATA = swh-archiver-data.sql SQLS = $(SQL_INIT) $(SQL_SCHEMA) $(SQL_FUNC) $(SQL_DATA) PSQL_BIN = psql PSQL_FLAGS = --single-transaction --echo-all -X PSQL = $(PSQL_BIN) $(PSQL_FLAGS) all: createdb: createdb-stamp createdb-stamp: $(SQL_INIT) createdb $(DBNAME) touch $@ filldb: filldb-stamp filldb-stamp: createdb-stamp cat $(SQLS) | $(PSQL) $(DBNAME) touch $@ dropdb: -dropdb $(DBNAME) dumpdb: swh-archiver.dump swh.dump: filldb-stamp pg_dump -Fc $(DBNAME) > $@ clean: rm -rf *-stamp $(DOCDIR)/ distclean: clean dropdb rm -f swh.dump .PHONY: all initdb createdb dropdb doc clean diff --git a/sql/swh-init.sql b/sql/swh-init.sql new file mode 100644 index 0000000..1165283 --- /dev/null +++ b/sql/swh-init.sql @@ -0,0 +1 @@ +create or replace language plpgsql;