I setup 3 profiles ( dev/test/prod ) workin like magic ( new to java and spring boot )
In my dev profile, database is generated with
hibernate.ddl-auto
workin great... also with
.hibernate.hbm2ddl.import_files
witch I use to populate the db with test-data
in the test-environment, I'd like to run a script instead, which sets up the db from a dump.. to be more like production (entity does not match db for some reason)
so I tried to use:
datasource.data
&& ||
datasource.schema
in different combinations, with file: , classpath prefixed .....
when I do:
datasource.data=data.sql
it's saying:
'ServletContext resource [/data.sql]' is invalid: The specified resource does not exist
... moved the file around .... /src/main /src/main/resources /src/main/resources/META-INF .. all that stuff
I don't get what it means by "ServletContext" ........
I did disable
hibernate.ddl-auto
by setting it to none in that profile
also
hibernate.jpa.generate-ddl
to false, even it is not needed / used when setting ddl-auto
...on my quest "google-searching" this, I came across posts from 2014 and got totally confused since things emerged from then ......
there is, I count on that ;) , some property which must be set to "runThisScript" but I got through the docs ...... possibly I missed something
someone can point me in the right direction?
thank you!
thx @Blagoj for your fast response, the link helped me .. the script gets executed by setting ddl-auto to create .. but it generates from entity too ... how to stop it from doing that && have the script executed ?
thx @luboskrnac for your advice! will take a look / use it ! .. what bothers me is, that i have to do it wrong/not so good from my oppinion... in dev to match prod ..... had hoped to do it right in dev and have prod on that state once i could proove that it is right ;)
... ok for now i ended up setting up test-environment by hand .. but will try to automate it once i know more ... i see there is always a tool for the injected-problem ;)