Closed JustSamuel closed 3 months ago
Going to close this since the automigration rollback wouldn't really work since they also hardcode all the keys and relations. This makes creating a function rollback quite difficult. My suggestion would just be good testing? Keep it running on develop for some time, that worked.
Better yet, try and prevent migrations.
So, as I made a mistake in my database migration (#175) I propose a better flow.
For each migration we should create a test case as follows:
Of course this only works on MySQL as you need a persistent DB schema across the test cases. We already have a test similar to that, but we use our own
up
anddown
defined migrations which means that the precondition of having the database as it was before we changed the database is not met.This should find those mistakes
Note: why don't we just always use the automigrate? I encourage you to check out the ungodly and unmanage sql that TypeORM spits out. I think we are better of writing our own, sensible, migrations.