Files
zkldi_Tachi/Justfile-db
T
zk dd2447c848 feat: i'm really worried about this bit, but empiricism will win (#41)
* feat: i'm really worried about this bit, but empiricism will win

* feat: light driving

* feat: migrate over user game status

* feat: custom scrollbar, and migrate over settings

* feat: eamusement csv movement

* fix: rm debug

* feat: shark reaction

* checkpoint

* feat: get tests passing again

* checkpoint

* feat: bms table sync

* feat: ugs snapshot and backsync bms pms

* feat: checkpoint

* feat: iidx playlists

* manic depression

* continues

* fly

* happy house

* we're happy here

* I think. 6 years is enough for me. This is killing me, and I am dying.
2026-03-31 23:37:51 +01:00

36 lines
1.3 KiB
Plaintext

POSTGRES_URL := "postgresql://tachi:tachi@tachi-postgres"
DEFAULT_DB := "tachi_dev"
# Open a psql shell against the local dev Postgres instance.
db POSTGRES_DB=DEFAULT_DB:
psql "{{POSTGRES_URL}}/{{POSTGRES_DB}}"
db-cheap-reset POSTGRES_DB=DEFAULT_DB:
#!/bin/bash
export POSTGRES_URL="{{POSTGRES_URL}}/{{POSTGRES_DB}}"
tachidb database drop
tachidb database create
tachidb migrate run
# Drop and recreate the database so migrations can be re-applied from scratch.
db-reset POSTGRES_DB=DEFAULT_DB:
#!/bin/bash
just db-cheap-reset "{{POSTGRES_DB}}"
just db-load-seeds "{{POSTGRES_DB}}"
# Show the status of all applied (and failed) migrations.
db-migrate-status POSTGRES_DB=DEFAULT_DB:
psql "{{POSTGRES_URL}}/{{POSTGRES_DB}}" -c \
"SELECT version, description, success, installed_on, execution_time || 'µs' AS execution_time \
FROM \"_migration\" \
ORDER BY version"
# Load the seeds into the database.
db-load-seeds POSTGRES_DB=DEFAULT_DB:
cd typescript/server && POSTGRES_URL="{{POSTGRES_URL}}/{{POSTGRES_DB}}" \
bun run src/scripts/load-seeds-pg.ts
# Reset templatedb from migrations, then dump schema and indexes for local debugging.
db-schema: (db-cheap-reset "templatedb")
pg_dump "{{POSTGRES_URL}}/templatedb" --schema-only --no-owner --no-acl -f db/schema.sql