3logy
3logy

Reputation: 2712

How to add H2 to a JHipster Application generated without it?

I'm using JHipster 4 to build Microservices. I have created an application without H2. But now we need one for development.

How to enable H2? i added H2 in the application-dev.yml :

h2:
    console:
        enabled: false
jpa:
    database-platform: io.github.jhipster.domain.util.FixedH2Dialect
    database: H2
    show-sql: true
    properties:
        hibernate.id.new_generator_mappings: true
        hibernate.cache.use_second_level_cache: true
        hibernate.cache.use_query_cache: false
        hibernate.generate_statistics: true

But it doesnt work. I can't access it

Upvotes: 1

Views: 581

Answers (1)

Gerald
Gerald

Reputation: 101

You could simply modify your .yo-rc.json by modifying the 2 entries:

"devDatabaseType": "h2Disk",
"prodDatabaseType": "postgresql",

and then regenerate your app/service by calling the jhipster generator.

Upvotes: 1

Related Questions