Schema, table and column names processing via custom migration class with Fluent Migrator
Schema, table and column names processing via custom migration class with Fluent Migrator
I'm writing a migration tool for modular applications which are intended to use internal modules, each with its own set of migrations.
Our applications are all based on dotnet core, may use different dbms and can use different conventions: each module in its own schema or not, custom table prefix per module, upper or lower case table names, etc.
Thus these conventions need to be told by the application itself while needing to write only once each migration in each module.
I'd like not to have to call a method call each time we insert a column name, table name, etc, for the developer not to have to have all this stuff in mind.
I started to reimplement each expression builder, but I feel it's very wrong and error-prone.
I also made a custom generic Migration class, inheriting Migration and having a naming convention interface as a generic type (which as three methods to transform schema, table, and columns), in order to register and resolve it with the service collection and use it to built SQL queries. I think this is the right approach.
I also made a method that can handle every kind of expression type to apply the transformations, but I'm stuck at this point and don't know where to call it.
Is there anything I'm doing wrong, is there any way I can accomplish what I want?
Thank you for your help. (also, sorry, I'm on my phone, and don't have a pc nor the code right now, but this is making me crazy)
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.