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

Comments

Projects
None yet
2 participants
@chb0github
Contributor

chb0github commented Dec 11, 2017

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

@chb0github

This comment has been minimized.

Contributor

chb0github commented Dec 11, 2017

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

@harawata

This comment has been minimized.

Member

harawata commented Dec 12, 2017

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

This comment has been minimized.

Contributor

chb0github commented Dec 12, 2017

@chb0github

This comment has been minimized.

Contributor

chb0github commented Dec 12, 2017

@harawata

This comment has been minimized.

Member

harawata commented Dec 12, 2017

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

This comment has been minimized.

Contributor

chb0github commented Dec 13, 2017

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

This comment has been minimized.

Contributor

chb0github commented Dec 23, 2017

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 harawata self-assigned this Aug 11, 2018

@harawata harawata added this to the 3.3.5 milestone Aug 11, 2018

@harawata

This comment has been minimized.

Member

harawata commented Aug 11, 2018

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