diff --git a/.gitignore b/.gitignore index 5bb30c3..53c8081 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +*~ *.cmi *.cmx *.o diff --git a/doc/uml-schema.dia b/doc/uml-schema.dia index b2dade4..3f29786 100644 Binary files a/doc/uml-schema.dia and b/doc/uml-schema.dia differ diff --git a/doc/uml-schema.png b/doc/uml-schema.png index 4940a37..ec21c30 100644 Binary files a/doc/uml-schema.png and b/doc/uml-schema.png differ diff --git a/sql/Makefile b/sql/Makefile new file mode 100644 index 0000000..b508225 --- /dev/null +++ b/sql/Makefile @@ -0,0 +1,18 @@ +SHELL=bash +CONFIG=/usr/groups/perfeng/rage/config +PERF_DB=$(shell grep "^perf_db" $(CONFIG) | awk -F '=' '{print $$2}') +PERF_HOST=$(shell grep "^perf_host" $(CONFIG) | awk -F '=' '{print $$2}') +PERF_USER=$(shell grep "^perf_user" $(CONFIG) | awk -F '=' '{print $$2}') +PERF_PASS=$(shell grep "^perf_pass" $(CONFIG) | awk -F '=' '{print $$2}') + +.PHONY: default +default: + @echo "Type 'make reset' to clear the database." + +.PHONY: reset +reset: schema.sql + PGPASSWORD=$(PERF_PASS) psql -h $(PERF_HOST) -U $(PERF_USER) $(PERF_DB) < $< + +.PHONY: clean +clean: + @rm -f *.{log,sql} diff --git a/sql/schema.sql b/sql/schema.sql index e41d278..e3458c0 100755 --- a/sql/schema.sql +++ b/sql/schema.sql @@ -8,6 +8,7 @@ drop table soms; drop table test_cases; drop table tiny_urls; +drop sequence tiny_urls_key_seq; create sequence tiny_urls_key_seq; grant all on tiny_urls_key_seq to "www-data"; create table tiny_urls ( @@ -61,7 +62,7 @@ grant select on branch_order to "www-data"; create table jobs ( job_id integer not null, build_id integer not null, - cmd text null, + job_cmd text null, primary key (job_id), foreign key (build_id) references builds(build_id)