0

i have an architectural problem.

Currently i am working on a Java Application based on Spring and Hibernate where Maven is the project/dependency management tool.

As far as i know, i can "create" the database each time i run the app.

<property name="hibernate.hbm2ddl.auto" value="update"/>

And this is where i get problems..is there any possibilty to get a workflow like this:

  1. Create .WAR File from your project (Done)
  2. Deploy .WAR File to Tomcat Server (Done)

... At this point only the filesystem should be present on the server, even if i run the app.

The database should be created in the next step ...

  1. SSH into Tomcat Server and run:
    1. command to create database+tables (run sql script..) (?)

This would be a great start.

In this case i could deploy new sql scripts (update1.sql, update2.sql, ...) and run updates on the database throw the command line.

Is there any documentation on this or do you know of this workflows?

Thanks anad Greetings!

Creative crypter
  • 1,348
  • 6
  • 30
  • 67

1 Answers1

0

Just remove this property (hibernate.hbm2ddl), or leave without value it also should do nothing. Another answer

Community
  • 1
  • 1
mihatel
  • 846
  • 14
  • 34
  • 1
    Can you please, let me know why it is not an answer ? – mihatel Mar 03 '17 at 15:04
  • Came across this answer in review. First of all the answer is not detailed enough is what i feel. And the question mentioned is about update manager and some docs – Gandhi Mar 03 '17 at 15:08
  • please correct me if I'm wrong... if I understood correctly question was how to avoid create DB automatically(problem: it is done via hibernate property, which mentioned in the question), I suggested to remove this property or leave value empty (). to my eyes there is not much to be more detailed or ? – mihatel Mar 03 '17 at 15:13
  • Is there any documentation on this or do you know of this workflows? - this is the crux of the question – Gandhi Mar 03 '17 at 15:20
  • Of course there should be doc, but I know it from my experience. Just search, there is even accepted [answer](http://stackoverflow.com/a/3179948/3266248) in stackoverflow :), but if you review and tell me it is not an answer I would like to know why it is not/wrong answer – mihatel Mar 03 '17 at 15:29
  • @Gandhi This clearly is an attempt to answer, it is in English, comprehensible and not link-only. So it should not be deleted from the LQQ. – Baum mit Augen Mar 03 '17 at 15:48
  • *"I would like to know why it is not/wrong answer"* A wrong answer wouldn't be a reason to review "delete" either. That's what normal downvotes are for. – Baum mit Augen Mar 03 '17 at 15:50
  • @mihatel I m not expert in this. Got it in my review list and I felt de answer is too short or less descriptive. In fact on review I jus could see this property not even the property name. Will agree if its answer – Gandhi Mar 03 '17 at 16:22