Open hsaraogi opened 6 years ago
Possible impl skeleton:
TransactionManagers
builderMight be an interesting edge case around how we define the tables to be deleted, since we likely don't want them included in the schema definition at the point we want to drop them. We certainly don't want to recreate the tables after cleaning them up, for example.
Can we just infer them? Look at the schema provided in code, look at what tables exist in the keyspace, calculate the diff.
Yes, that looks feasible. KVS.getAllTableNames
fetches all non-KVS table names, including Atlas internal tables. Probably need to make sure that there's no cases where this deletes tables by accident, but I can't think of a good reason for removing a table from the schema without expecting it to be deleted.
There's probably some edges here around dynamically created tables in PG land that we probably need to protect against.
Fair point, that's one argument for the more intentional version of explicitly listing tables.
Also probably issues around migration rollback if we immediately truncate the unlisted table
This would allow cleaning up of cruft after migrations and unsupported tables.