Closed Electron100 closed 1 year ago
:+1:
It would be good to call this from within the test harness, so each test module doesnt have all of the migrations of all of the tests. Ideally it is run before the macros in the tests. Running it afterwards (in the db shutdown hook?) would delete potentially useful data, but I guess that doesnt matter much if the tests passed.
It would be good to call this from within the test harness, so each test module doesnt have all of the migrations of all of the tests
Maybe I'm being obtuse, but I don't think that will work. In my observation, within a given project cargo test
builds all test binaries before executing any of them. Which is perhaps an argument for decoupling schema-generation-time from proc-macro-execution-time -- if they were decoupled then we could do as you suggest.
Of course you are right. Sorry for the distraction.
Clean current migration state. Deletes the current migration working state which is generated on each build. This can be used as a workaround to remove stale tables from the schema, as Butane does not currently auto-detect model removals. The next build will recreate with only tables for the extant models.
This is a workaround for #44