Clean database start (only project states)
After running migrations, the only data in the database is the project lifecycle states (seven rows in project_states: planning, request_funding, waiting_for_launch, running, closed, terminated, not_funded). All other lookup data (orgs, role types, country holidays, etc.) is added via the UI or scripts.
To get a database in that “clean” state you can either use a new database or reset an existing one.
Option A: Use a new database
- Create a new empty database in your PostgreSQL instance (e.g. same server, different name).
- Set
DATABASE_URLto point to that database (e.g.postgresql://rediflow:rediflow@localhost:5432/rediflow_clean). - Run migrations:
uv run python main.py migrate - You now have a clean database: schema + project states only.
Option B: Reset the existing database
This destroys all data in the current database.
-
Connect to PostgreSQL with a user that can drop databases (e.g.
postgres). Using the default compose database name and user:psql -h localhost -p 5432 -U postgres -d postgres(If your instance uses the same user as the app, you may need to connect as a superuser or the owner of the database.)
-
Drop and recreate the database (replace
rediflowwith yourPOSTGRES_DB/ database name if different):DROP DATABASE IF EXISTS rediflow; CREATE DATABASE rediflow OWNER rediflow; \q -
Set
DATABASE_URLto that database and run migrations:uv run python main.py migrate
Result: schema + project states only.
After a clean start
-
Settings / lookups: Add orgs, role types, calendars, etc. via Settings in the UI, or bulk-load from an export:
uv run python scripts/seed_settings_data.py --json tmp/settings_export.jsonSee How to populate fixtures (export and re-import settings data).
-
Projects: Create projects from the UI (Projects → New project) or import from fixtures (see populate-fixtures).
-
Setup: For a full new-customer flow, see Overview and Initial data entry.