Skip to content

Database Setup

Arthu Santiago edited this page Nov 30, 2026 · 2 revisions

Database Setup

The database is empty so far. This page runs the migrations, which create every table KeyAnyWhere uses and the uuid-ossp extension, and then checks the result.

Before you start

The kaw-cake command must work, as in Environment Variables.

1. Run the migrations

Migrations are versioned scripts in config/Migrations/. Running them again later is safe: only the ones not applied yet run. That is also how an upgrade updates the database.

sudo -u www-data kaw-cake migrations migrate

The output lists each migration and ends with All Done. Outside development, KeyAnyWhere skips the schema snapshot (config/Migrations/schema-dump-default.lock) that the command would otherwise write into the code folder, which is read-only for www-data; the snapshot is only used in development.

2. Check that it worked

migrations status lists every migration and whether it was applied:

sudo -u www-data kaw-cake migrations status

Every line should read up. These are the tables you should have:

psql "host=127.0.0.1 dbname=keyanywhere user=kaw" -c '\dt'
auditorias, cake_migrations, categorias, configuracoes, entradas, eventos_seguranca,
insecure_passwords, sessions, users

Next step

Insecure Password Catalog

Clone this wiki locally