This repository was archived by the owner on Sep 15, 2022. It is now read-only.
Some Questions #2
vincentlauvlwj
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, @UnknownJoe796
First I want to apologize for my late response, I was so busy earning my life in the past monthes that I even have no time to review your code.
I've read your code these days and came up with some thoughts and questions that I want to discuss with you. Please let me know what you think by leaving a message here when you have time.
In my original plan, this project will have at least 4 submodules:
ktorm-migration-runtime
provides runtime support for migration, including schema definition, DDL SQL generation and execution. However migration file generation (for example themakeMigrations
function) should not in this module according to my plan, I think it should be provided in separated tools.ktorm-migration-cli
provides a CLI tool to support migration file generation, I think this should not be part of runtime. It's weired to generate code for an application by running the application itself, in my opinion, it's a better practice to make the code generation stuff separated from the application code.ktorm-migration-gradle-plugin
is a gradle plugin based onktorm-migration-cli
to make the code generation tool better to use.ktorm-migration-maven-plugin
is a maven plugin based onktorm-migration-cli
to make the code generation tool better to use.I thought about doing some refactoring based on your code to achive this plan, but it seems there will be problems when implementing the CLI tool. As the tool is separated from the application code, we cannot construct the schema info because the CLI tool has a different classpath with our applications. What do you think about this problem?
Another question is why do you implement migration by generating and maintaining some migration files? What about reading the schemas from the database, compare them with the newest schemas in the application code, and then perform changes every time the application restarts. I think this might be another way for us. In this way, we don't need to deal with the code generation stuff anymore. What do you think? Please let me know.
Beta Was this translation helpful? Give feedback.
All reactions