How can I safely rollback a Fastify plugin after a schema change without breaking encapsulation?
I am developing a Fastify plugin that adds a decorator based on the current database schema. When I need to alter the schema, I want to be able to revert the plugin’s changes if the migration fails, while keeping the plugin encapsulated and its dependencies validated through fastify-plugin. The plugin is registered with a name, dependencies, and encapsulate: