mirror of
https://github.com/clockworklabs/SpacetimeDB.git
synced 2026-05-14 03:37:55 -04:00
9bb2b21507
The `TableDef` type is nominally the same for the database schema and the schema description from a module, but only the former contains information about indexes and sequences. This would cause all indexes to be dropped when updating a database, because none of the existing indexes would ever be present in the module's schema definition. It is unclear if the functionality could be recovered, but it does not seem to be robust without a dedicated schema manipulation language either way. We still want to allow module updates which do not change the schema at all, or only introduce new tables, as otherwise users may be forced to re-run expensive initialisation steps even though they only introduced debugging code or somesuch. To make this work, a somewhat dubious equivalence comparison is made, comparing the constraint definitions in a way deemed correct in post-hoc analysis.