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

Auto add new columns and new tables to db on version increase #61

Closed
tasomaniac opened this issue Oct 22, 2016 · 3 comments
Closed

Auto add new columns and new tables to db on version increase #61

tasomaniac opened this issue Oct 22, 2016 · 3 comments

Comments

@tasomaniac
Copy link

Depending on the version number, do you think that it is possible to keep the state of the table and automatically determine the changes to the columns and tables?
If it is possible, maybe there can be a way to auto add new tables and new columns to databases. These 2 types of migrations should be pretty straightforward if that is possible.

@SimonVT
Copy link
Owner

SimonVT commented Oct 24, 2016

I'd rather have a @Version annotation than have the database be committed in some format.
This is tracked in #49, but no work has been done on it.

@tasomaniac
Copy link
Author

I saw that before opening this.
I believe version annotations on tables can be simpler to do.
I opened this because I think there can even be an automated way to do it. I will investigate further.

@SimonVT
Copy link
Owner

SimonVT commented Oct 25, 2016

Sure, it's easy enough to automatically add missing tables or columns. I'm just not sure I like adding that much magic.
Developers might expect more things to happen automatically, like adding or changing a default value. This just isn't possible without renaming the old table, creating the new table, copying data over and dropping the old table.
Rather than introducing too much behavior that isn't obvious from looking at the code I'd much rather provide annotations (e.g. @Version) and utility classes (e.g. helper methods for checking if a column exists) that makes the developers life easier.

@SimonVT SimonVT closed this as completed Dec 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants