Bootstrap the system tables from the commitlog
The purpose of this ticket and corresponding PR is the following:
Currently some rows are inserted into system tables by the bootstrapping code. If we ever wanted to change the system tables for existing databases, then we would have to maintain two versions of the bootstrapping code. One for the old database which were initially bootstrapped with the old code and one for the new database which was bootstrapped with the new code. This is complex.
Instead we want to make it so that the only tables which have rows inserted into them on startup is st_table and st_column and that all rows in all other tables are inserted into the commitlog. Thus making it so that migrating a system table is the same as migrating any table. We would old need the old system table code if we wanted to look at the historical state of a system table in an old database.
Food for thought, Postgres creates a template1 database and then clones it to create all other new databases.
We think it's unlikely we'll get this in for 1.0. We'll have to deal with this limitation throughout 1.0, i.e. not being able to change system tables.
Does this mean we can't add more system tables? We'll need to think about this a bit more, it's not obvious.
@jsdt I hear that you have thought about this some. In our meeting, we suspect it was something like "we can add tables, but then we can't roll back; maybe we need to ignore any unknown system tables to enable rollback"?
more context: this will come up soon with the new auth claims table
@jdetter would like being able to add a table and then be able to roll back without spacetimedb choking on it