mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-11-09 19:20:09 +01:00
fix(config): auto-route test.db locally, posterg.db on production
- config.php: getDatabasePath() detects php built-in CLI server (php_sapi_name() === 'cli-server') and routes to test.db; all other SAPIs (nginx/fpm) get posterg.db. DB_ENV env-var still overrides either way. - migrate.sh: auto-initialise the target DB from storage/schema.sql when the file is absent or has no tables yet. Existing DBs with data are left completely untouched (table_count check, no re-run of schema on populated DB). Idempotent: safe to run repeatedly. - justfile: serve still calls migrate (which now handles init too), no DB_ENV prefix needed since sapi detection handles routing.
This commit is contained in:
1 parent
877e322568
commit
a88e5562f8
5 files changed
+28
-16
No files matched your search
Binary file not shown.
Binary file not shown.
Reference in new issue
Block a user