Seed fresh local DB from .dev production dump automatically
This commit is contained in:
1 parent
abf482eeb0
commit
23e07f12e5
3 files changed
+29
-7
No files matched your search
@@ -28,11 +28,14 @@ tables byte-for-byte (verified by diffing `mariadb-dump --no-data` against the p
|
||||
its creates are guarded with `Schema::hasTable`, so running `migrate` on production only
|
||||
records it. Add new migrations in the backend for any schema change; the site app has none.
|
||||
|
||||
To work with real content, load a production dump (drops and recreates the local DB):
|
||||
Real content: drop the production export at `.dev/greaterc_db2024.sql` (or the `.sql.zip`
|
||||
phpMyAdmin produced — it's unzipped on demand; both are git-ignored). A fresh DB seeds
|
||||
itself from it on first `nix run`; existing data is never overwritten on restart.
|
||||
|
||||
```sh
|
||||
nix run . -- db import .dev/greaterc_db2024.sql # phpMyAdmin export, kept out of git
|
||||
nix run . -- db reset # back to empty schema
|
||||
nix run . -- db reset # wipe + reseed from the dump (or empty schema if none)
|
||||
nix run . -- db import other.sql # load a different dump
|
||||
DEV_DB_DUMP=/path/to/x.sql nix run # use a dump elsewhere
|
||||
```
|
||||
|
||||
`nix run . -- <cmd>` forwards to the `dev` script; `nix develop` drops you into a shell with
|
||||
|
||||
Reference in new issue
Block a user