title: incompatible types: numeric and bigint. In PostgreSQL
body: <p>While migrating to postgresql, I'm facing below issue </p>
  
  <p>Key columns <code>veh_reg_authority</code> and <code>id</code> are of incompatible types: <code>numeric</code> and <code>bigint</code>.
  Below are mappings:</p>
  
  <pre><code>@ManyToOne(fetch = FetchType.LAZY)
  @JoinColumn(name = "VEH_REG_AUTHORITY", columnDefinition ="Numeric(12,0)")
  private VehicleRegistrationAuthority vehicleRegistrationAuthority;
  </code></pre>
  
  <p><code>VehicleRegistrationAuthority</code> has <code>id</code> of type <code>Long</code> so which in converted to <code>BIGINT</code> as per PostgreSQL.</p>
  
  <p>So one simple solution is to change columnDefinition ="Numeric(12,0)" accordingly, but we can't do that as it works well with oracle and mysql, and it's been used heavily in out code so not possible to change.</p>
  
  <p>Below are types in Oracle, Mysql, and PostgreSQL:</p>
  
  <pre><code>column                          java type             Oracle     Mysql   PostgreSQL
  id                               Long                 NUMBER     BIGINT  BIGINT
  veh_reg_authority VehicleRegistrationAuthority        NUMBER   decimal(12,0) NUMERIC
  </code></pre>
  
  <p>While creating foreign key hibernate gives below issue.</p>
  
  <pre><code>Caused by: org.postgresql.util.PSQLException: ERROR: foreign key constraint "fk7gyqskn6x2l2910xhhtjgvh0j" cannot be implemented
  Detail: Key columns "veh_reg_authority" and "id" are of incompatible types: numeric and bigint.
  </code></pre>