No description
scripts/sync_prod_to_local.sh pulls only rows whose updated_at is newer than the corresponding local row, versus restore_prod_to_local which does a full pg_dump + drop + restore. For day-to-day refreshes the incremental path is dramatically cheaper — the full dump is ~12 GB, while an hourly incremental is typically a few thousand rows. Approach: - Discover every public table that carries `updated_at` (skips the oban_* runtime tables and schema_migrations by default). - For each, intersect the column list across local and prod so schema drift (a new column on prod not yet migrated locally, or vice-versa) doesn't break the sync — we transfer the columns that exist on both sides and leave the rest alone. - Resolve the ON CONFLICT target: primary key first, else the shortest non-partial unique index (important for partitioned tables like hrrr_profiles which have no top-level PK). - Stream the changed rows via `\COPY ... TO STDOUT` into a per-table temp file, then load into a LIKE-cloned temp table and UPSERT across `SET session_replication_role = replica` so FK ordering doesn't block the dev-only run. - Partitioned parents (relkind='p', relispartition=false) are kept in the discovery list; partition children (relkind='r', relispartition=true) are excluded so INSERTs route through the parent. Flags: `--dry-run` counts without writing; a positional argument limits the run to a single table. `SKIP_TABLES` env var overrides the exclusion list. Also added a pointer from restore_prod_to_local.sh's header comment to the new script. |
||
|---|---|---|
| .forgejo/workflows | ||
| .github | ||
| assets | ||
| bin | ||
| config | ||
| docs | ||
| k8s | ||
| lib | ||
| lib_ml | ||
| notebooks | ||
| priv | ||
| rel | ||
| rust/prop_grid_rs | ||
| scripts | ||
| test | ||
| vendor | ||
| .credo.exs | ||
| .dockerignore | ||
| .formatter.exs | ||
| .gitignore | ||
| .tool-versions | ||
| AGENTS.md | ||
| algo.md | ||
| app.json | ||
| CLAUDE.md | ||
| Dockerfile | ||
| elevation.md | ||
| LICENSE | ||
| mix.exs | ||
| mix.lock | ||
| prediction.md | ||
| README.md | ||
| tail_logs.sh | ||
| updates.md | ||
Microwaveprop
To start your Phoenix server:
- Run
mix setupto install and setup dependencies - Start Phoenix endpoint with
mix phx.serveror inside IEx withiex -S mix phx.server
Now you can visit localhost:4000 from your browser.
Ready to run in production? Please check our deployment guides.
Learn more
- Official website: https://www.phoenixframework.org/
- Guides: https://hexdocs.pm/phoenix/overview.html
- Docs: https://hexdocs.pm/phoenix
- Forum: https://elixirforum.com/c/phoenix-forum
- Source: https://github.com/phoenixframework/phoenix