fix(setup): reduce friction in installation procedure

- Add Language default ("jp") so missing field no longer produces empty
  string, and include language selector in setup wizard
- Add --setup flag to re-run wizard even when config.json exists,
  providing a recovery path for corrupted configs
- Auto-apply seed data on fresh databases so users who skip the wizard
  still get shops, events, and gacha
- Fix stale docs referencing non-existent init/setup.sh and
  schemas/patch-schema/ in docker/README, CONTRIBUTING, and README
This commit is contained in:
Houmgaor
2026-02-23 23:39:49 +01:00
parent 210cfa1fd1
commit bcdc4e0b7e
7 changed files with 67 additions and 39 deletions

View File

@@ -153,25 +153,18 @@ func TestYourFunction(t *testing.T) {
## Database Schema Changes
### Patch Schemas (Development)
Erupe uses an embedded auto-migrating schema system in `server/migrations/`.
When actively developing new features that require schema changes:
When adding schema changes:
1. Create a new file in `schemas/patch-schema/` with format: `NN_description.sql`
2. Increment the number from the last patch
3. Test the migration on a clean database
4. Document what the patch does in comments
1. Create a new file in `server/migrations/sql/` with format: `NNNN_description.sql` (e.g. `0002_add_new_table.sql`)
2. Increment the number from the last migration
3. Test the migration on both a fresh and existing database
4. Document what the migration does in SQL comments
**Important**: Patch schemas are temporary and may change during development.
Migrations run automatically on startup in order. Each runs in its own transaction and is tracked in the `schema_version` table.
### Update Schemas (Production)
For release-ready schema changes:
1. Consolidate patch schemas into update schemas
2. Create a new file in appropriate schema directory
3. Update schema version tracking
4. Test migration paths from previous versions
For seed/demo data (shops, events, gacha), add files to `server/migrations/seed/`. Seed data is applied automatically on fresh databases and can be re-applied via the setup wizard.
## Documentation Requirements