mud icon indicating copy to clipboard operation
mud copied to clipboard

deployer should throw if table ID exists with diff schema

Open frolic opened this issue 1 year ago • 1 comments

we currently skip existing tables

https://github.com/latticexyz/mud/blob/5a6c03c6bc02c980ca051dadd8e20560ac25c771/packages/cli/src/deploy/ensureTables.ts#L32

which is good if the table is the shape we expect, because they're considered immutable

but if you were to override a table schema in your config, this should throw an error rather than skipping, to help teach that table schemas are immutable

frolic avatar Sep 19 '24 17:09 frolic

you could sorta work around this in latest MUD with labels: you give it a different table name but leave the table label alone (so table libs end up the same, just the table ID changes), that way a new table is deployed with the new schema (it'd be empty though)

frolic avatar Sep 19 '24 17:09 frolic