mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 19:19:19 +02:00
- 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.
11 lines
697 B
Markdown
11 lines
697 B
Markdown
# TODO
|
|
|
|
## Fixes
|
|
- [x] Fix CSV import UNIQUE constraint crash: skip rows whose identifier already exists in DB
|
|
- [x] Auto-migrate both test.db and posterg.db on `just serve` via scripts/migrate.sh
|
|
- [x] Fix wrong `require_once` depth in `public/admin/actions/page.php` (`../../` → `../../../`)
|
|
- [x] Fix same path depth bug in `formulaire.php` and `publish.php`
|
|
- [x] Fix CSV import: imported theses not visible on public site (is_published defaulted to 0, access_type_id never set)
|
|
- [x] Fix DB routing: local dev (php -S) auto-uses test.db, production (nginx/fpm) uses posterg.db — no env var needed
|
|
- [x] migrate.sh auto-initialises DB from schema when absent/empty; existing DBs untouched
|