I was wondering if there is some documentation or advice on how to manage database schema changes?
Because we are not yet in production, we are currently just dropping the db and re-initialising with a new schema each time we make a schema change. For production, we currently have the following procedure:
- The developer makes the schema change to a ‘master schema’, which is used to initialise a new database. The developer also creates a ‘schema change’ file with a version number, which is the next number from a version recorded in the database (in a version vertex). The schema change file contains define and undefine statements.
- An endpoint is called that fetches the latest schema version from the db, and then applies each schema change file.
What implications should we know about when it comes to schema changes? What are the side-effects of changing an attribute type and what is the best way to go about that? Are there any tools to help us in cases that we want to change the name of an attribute?