cancel
Showing results for 
Search instead for 
Did you mean: 

dbCreate strategy

mlawler
Champ in-the-making
Champ in-the-making
Current DbSchema strategies are:

  CREATE, CREATE_DROP, DROP_CREATE, CHECK_VERSION

I would like one that CREATEs the schema if it doesn't already exist, but if it does already exist, then it runs CHECK_VERSION (and leaves the data alone).

i.e. I want schema creation to be an automatic part of my application bootstrap, not an explicit step that an admin must perform. (grails works this way quite well).

Is there a reason why this would be a bad idea? Could I contribute a patch to provide this behaviour?
1 REPLY 1

tombaeyens
Champ in-the-making
Champ in-the-making
adding support for that capability in the implementation is wanted.   but i don't want to expose that functionality as supported or normal usage.

i recently switched from using an enum to a string configuration for that.  this way, the API can expose constant strings for CREATE_DROP (for testing) and CHECK_VERSION (in production) as those are the only ones that I want to see exposed to all users.

all the other strategies (including the one you propose) should only be used if you know what you're doing.  i'm ok with supporting these, but not to have constants for those in the API.

if you want to contribute, sign the contributor agreement (see wiki), create a jira issue and associate a patch with the issue.