Skip to content

Require the Aiven user and port and rewrite the mock data - #2

Merged
bpstack merged 2 commits into
mainfrom
claude/compassionate-planck-gh6aof
Oct 5, 2026
Merged

bpstack merged 2 commits into
mainfrom
claude/compassionate-planck-gh6aof

Conversation

@bpstack

@bpstack bpstack commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Dos cambios antes de hacer público el repositorio.

Cambios

  • Credenciales de Aiven sin valores por defecto (0bb4c1f): config/db.ts y apply-migration.sh ya no publican el usuario y el puerto de producción; el backend no arranca sin AIVEN_DB_USER y AIVEN_DB_PORT, igual que con el host. Render los define en producción y en preview.
  • Mock nuevo (a474007): mock-data.sql vacía y recarga todos los módulos salvo usuarios, catálogos y horarios, en una transacción; usa los usuarios existentes por rol, sin crear cuentas ni hashes de contraseña; busca departamentos, métodos de pago y categorías por nombre.

Comprobado

  • CI en verde en a474007.
  • Preview: Render desplegó solo desde este repositorio; la API responde y consulta la BD.
  • Mock probado en local y aplicado en Aiven: usuarios y horario sin cambios.

- config/db.ts: AIVEN_DB_USER and AIVEN_DB_PORT have no fallback; the
  backend refuses to start without them, like AIVEN_DB_HOST
- apply-migration.sh: same for the migration runner

Why: the fallbacks published the database user and port of the
production service. Render defines both variables in production and
preview, so nothing changes there.
…hema

- Clear and reload every module except users, catalogs and scheduling,
  inside one transaction
- Use the existing users by role and stop before deleting anything if
  there is no active admin; no user rows or password hashes
- Look up departments, payment methods and categories by name, since
  their ids differ between installations
- Add F&B revenue, cashier vouchers, denominations and daily totals that
  match the app's cash formula, and the history rows of each module
- Describe the file in the db-mysql AGENTS.md and INDEX.md trees

Why: the old script created users with a published password hash, used
fixed ids that broke after a delete, and predated several modules. The
new one fills a public demo or a local database with fictitious data.
@vercel

vercel Bot commented Oct 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
four-points Ready Ready Preview Oct 5, 2026 12:28pm UTC

@bpstack
bpstack merged commit 7004a94 into main Oct 5, 2026
6 checks passed

This branch was successfully deployed

1 active deployment
Preview — a4740077 Deployed Oct 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant