Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

before_new and after_new hooks #106

Closed
chb0github opened this issue Dec 11, 2017 · 8 comments · Fixed by #126
Closed

before_new and after_new hooks #106

chb0github opened this issue Dec 11, 2017 · 8 comments · Fixed by #126
Assignees
Milestone

Comments

@chb0github
Copy link
Contributor

I would like to implement before/after new hooks as they exist for the other hooks. Any objections?

@chb0github
Copy link
Contributor Author

I am also willing to fold-in a dockerfile as per #105 to see this change accepted.

@harawata
Copy link
Member

Hi @chb0github ,

Could you elaborate on the use case?
new command is rather unique and we may need to know what you are trying to achieve with the hooks to make it useful.

@chb0github
Copy link
Contributor Author

chb0github commented Dec 12, 2017 via email

@chb0github
Copy link
Contributor Author

chb0github commented Dec 12, 2017 via email

@harawata
Copy link
Member

Thank you for the explanation!
Description validation looks useful.

There is one thing I would like to discuss first.
As new is one of the commands that are independent of environment, the environment properties file does not seem to be the right place to configure new-hooks.
What do you guys think about adding a per-project configuration file and store environment-independent settings?

As a background, script_char_set also is independent of environment and I have been thinking about (gradually) migrating it to the per-project config file.

Cc-ing @h3adache .

@chb0github
Copy link
Contributor Author

I don't have much knowledge on the subject, but let me ask:

What's the difference between mybatis.properties and an environment property set? Outside of the local directory, what more is needed?

put it all in mybastis.properties and have the default environment something you can configure

As for the hooks: I would say that git has the right idea: create a .hooks directory and use convention. I mean, the migration scripts are run based on convention so why should the hooks be by configuration?

And, putting them in a .hooks directory keeps the project uncluttered as it's a hidden directory.

So, like 01_before_up_dosomething.groovy

@chb0github
Copy link
Contributor Author

I have a working implementation of new hooks. It follows current coding conventions and hook mechanisms. Our discussion about other changes went nowhere. So, I would like to get this accepted and have discussions about refactoring occur after

@harawata
Copy link
Member

Thank you, @chb0github .
before_new and after_new hooks are now available in the latest 3.3.5-SNAPSHOT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants