Record a database's grid, so tile pruning cannot guess it wrong
Source:R/cell_model.R
cell_grid_write.Rdcell_grid_ncol() resolves the grid width from a cell_grid table in the database
and otherwise falls back to v8's 7200. No release ever wrote that table, so the
fallback was always taken — correct for global05 by coincidence and wrong for every
usa05 release. The consequence was silent and total: cell_model is Hive-partitioned
by a tile id computed from the grid width, so a wrong width computes a different, valid
tile id, WHERE tile IN (…) prunes away the only partition holding the cells, and the
clicked-cell species list came back empty on v1-v7 rather than failing. Measured on
the promoted release: a v7 cell with 477 models returned 0 species.
Details
Call this when building a serving database, before cell_model_tile_check().