From: Don Armstrong Date: Fri, 24 Mar 2017 16:15:08 +0000 (-0700) Subject: add initial information on how to use the debbugs SQl database X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=95cb426f2260c6c448d64cccd96fa870e4b84547;p=debbugs.git add initial information on how to use the debbugs SQl database --- diff --git a/README_sql.md b/README_sql.md new file mode 100644 index 0000000..43e7314 --- /dev/null +++ b/README_sql.md @@ -0,0 +1,42 @@ +# Bringing up SQL for Debbugs + +## Creation of database + +Debbugs needs a postgresql database (≥ 9.4) with the debversion +extension installed. `apt-get install postgresql-9.5 +postgreql-9.5-debversion` to install those two packages. + +Then create a database and enable the debversion extension: + + echo 'create database debbugs' | psql; + echo 'create extension debversion' | psql debbugs; + +Debbugs also expects to be able to connect to databases using +a +[postgresql service definition](https://www.postgresql.org/docs/current/static/libpq-pgservice.html) which +defines the host, port, database, and any other connection information +which is needed. The default service is 'debbugs', but this can be +configured using `/etc/debbugs/config` or the `--service` option to +most commands. The most simplistic `~/.pg_service.conf` looks like this: + + [debbugs] + host=localhost + database=debbugs + +## Insert database schema + +To create the database schema, run `debbugs-installsql +--service=debbugs --install` (replacing debbugs with whatever the +appropriate service is.) The `debbugs-installsql` command also has an +`--upgrade` option which can be used to upgrade the schema between +schema revisions. + +## Populate database initially + +1. Insert configuration `debbugs-loadsql configuration` +2. Add suites `debbugs-loadsql suites --ftpdist /srv/ftp.debian.org/dists` +3. Add packages `debbugs-loadsql packages --progress --ftpdist /srv/ftp.debian.org/dists` +4. Add bugs `debbugs-loadsql bugs --progress --preload` +5. Add bug logs `debbugs-loadsql logs --progress` +6. Add maintainers `debbugs-loadsql maintainers` +