1 # Bringing up SQL for Debbugs
3 ## Creation of database
5 Debbugs needs a postgresql database (≥ 9.4) with the debversion
6 extension installed. `apt-get install postgresql-9.5
7 postgreql-9.5-debversion` to install those two packages.
9 Then create a database and enable the debversion extension:
11 echo 'create database debbugs' | psql;
12 echo 'create extension debversion' | psql debbugs;
14 Debbugs also expects to be able to connect to databases using
16 [postgresql service definition](https://www.postgresql.org/docs/current/static/libpq-pgservice.html) which
17 defines the host, port, database, and any other connection information
18 which is needed. The default service is 'debbugs', but this can be
19 configured using `/etc/debbugs/config` or the `--service` option to
20 most commands. The most simplistic `~/.pg_service.conf` looks like this:
26 ## Insert database schema
28 To create the database schema, run `debbugs-installsql
29 --service=debbugs --install` (replacing debbugs with whatever the
30 appropriate service is.) The `debbugs-installsql` command also has an
31 `--upgrade` option which can be used to upgrade the schema between
34 ## Populate database initially
36 1. Insert configuration `debbugs-loadsql configuration`
37 2. Add suites `debbugs-loadsql suites --ftpdist /srv/ftp.debian.org/dists`
38 3. Add packages `debbugs-loadsql packages --progress --ftpdist /srv/ftp.debian.org/dists`
39 4. Add bugs `debbugs-loadsql bugs --progress --preload`
40 5. Add bug logs `debbugs-loadsql logs --progress`
41 6. Add maintainers `debbugs-loadsql maintainers`