Closed kiran-vadla closed 7 years ago
Can one of the admins verify this patch?
Attached is the updated guide.
Thanks, Kiran. DBIntegration - PostGreSQL - Guide.docx
Hi,
I'm trying to make this work with Postgre using docker but I think there are some steps missing on the documentation. Also I think we can document this process with docker as it is very easy to work with different versions of different databases)
Start by having docker installed (or docker-toolbox if you are in windows/mac)
Start a Postgre server (version 9.5.4)
docker run --name postgres -p 5432:5432 -e POSTGRES_PASSWORD=mysecretpassword -d postgres:9.5.4
We can access this postgre server on our docker machine, so in linux it will be @localhost:5432 but using docker-machine (in my case) it is on 192.168.99.100:5432
Access postgress with sqldb
docker run -it --rm --link postgres:postgres postgres psql -h postgres -U postgres
Create a database
create database mydb;
Create an schema
create schema oasp4j
Execute the script on the wiki page: https://github.com/oasp-forge/oasp4j-wiki/wiki/DB-Integration-PostGres-Server-9.5.4
modify the profile on app.properties of the restaurant app to use postgre profile
spring.profiles.active=postgre
configure the proper IP for the postgre server on application-postgre.properties
spring.datasource.url=jdbc:postgresql://192.168.99.100:5432/oasp4j?currentSchema=oasp4j
Runing the sample application I see this on the log files
[L: org.flywaydb.core.internal.command.DbMigrate] - [M: Current version of schema "oasp4j": << Empty Schema >>] [L: org.flywaydb.core.internal.command.DbMigrate] - [M: Schema "oasp4j" is up to date. No migration necessary.]
so... I don't know the reason it is not running the migration files and why is it thinking that oasp4j is up to date....
Also I had to add to the application-postgres.properties the following:
flyway.schemas=oasp4j
@anmaso , To install Docker Toolbox, virtualisation has to be enabled in my system BIOS settings . I have raised a ticket with my local support team for enabling the same. This will take some time . Meanwhile , if you have some time , will you please try setting up 'DBIntegration code with PostGres' without using Docker and let me know if you face any issues.
Thanks, Kiran.
I've found that was my mistake not renaming some of the sql files for postgre
Now I have the restaurant example running great on postgre in docker!
I will merge the changes as soon as I read through the changed files
@amarinso , closing this , as I have created a new pull request https://github.com/oasp/oasp4j/pull/526 under a branch on 'develop-2.3.0'
Please review this pull request for OASP4J - DBIntegration of PostGres 9.5.4.