Commit graph

3 commits

Author SHA1 Message Date
Dave Syer
b559077f14 Remove manual id management in child entities
This is reverting a workaround for a Hibernate "feature". There's
no need for the child entities (Pet and Visit) to know about their
parent (foreign key). Hibernate can manage that just fine with a
@JoinColumn. But it needs a nullable foreign key column in the
DB schema. That's the downside. The upside is much less code in
Java.
2022-01-06 11:23:02 +00:00
Shaan Sapra
43beff91a3 Avoid dropping Postgres schema
The postgres user needs to be an owner of the public schema or a
superuser in order to execute the schema.sql for database
initialization.

To avoid that, two changes are required:
 - use `CREATE TABLE IF NOT EXISTS` in order to idempotently create the
   necessary tables
 - handle conflicts when inserting duplicate data

This follows the pattern in use by the
src/main/resources/db/mysql/{data,schema.sql} files.

Authored-by: Shaan Sapra <shsapra@vmware.com>
2022-01-06 07:22:50 +00:00
Fabian Muscariello
ce626da705 Add support for PostgreSQL
See #636
2021-12-07 16:55:01 +00:00