eee25e8d27
In most dev/testing environments it is nice to have a way to reset/rollback the entire database. This commit adds this feature in the most basic form; when Rollback() is called, it will rollback ALL migrations that have run leaving the database is a mostly pristine state. There are a few potential issues here. For starters, devs may not always want all migrations to be rolled back. The only current fix is to course in this case is to create a migrator that only contains migrations they want rolled back. Another potential issue is that any migration that doesn't provide a Rollback function will not be rolled back, but there also won't be any errors. A message is printed out when this happens to help avoid some confusion, but I could see this still causing issues. I'm not 100% sure what the best long term solution is, but feel the current version is good enough to move forward since it satisfies my needs.
2 lines
21 B
SQL
2 lines
21 B
SQL
DROP TABLE widgets;
|
|
|