package com.leevilehtonen.cookagram.config;

import org.hibernate.dialect.PostgreSQL94Dialect;
import org.hibernate.type.descriptor.sql.BinaryTypeDescriptor;
import org.hibernate.type.descriptor.sql.SqlTypeDescriptor;

import java.sql.Types;

public class PostgreSQLDialectCustom extends PostgreSQL94Dialect {

    @Override
    public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) {
        if (sqlTypeDescriptor.getSqlType() == Types.BLOB) {
            return BinaryTypeDescriptor.INSTANCE;
        }
        return super.remapSqlTypeDescriptor(sqlTypeDescriptor);
    }
}

@@ -92,510 +92,244 @@
 ct;%0A
-import org.hibernate.type.descriptor.sql.BinaryTypeDescriptor;%0Aimport org.hibernate.type.descriptor.sql.SqlTypeDescriptor;%0A%0Aimport java.sql.Types;%0A%0Apublic class PostgreSQLDialectCustom extends PostgreSQL94Dialect %7B%0A%0A    @Override%0A    public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) %7B%0A        if (sqlTypeDescriptor.getSqlType() == Types.BLOB) %7B%0A            return BinaryTypeDescriptor.INSTANCE;%0A        %7D%0A        return super.remapSqlTypeDescriptor(sqlTypeDescriptor
+%0Aimport java.sql.Types;%0A%0Apublic class PostgreSQLDialectCustom extends PostgreSQL94Dialect %7B%0A%0A    public PostgreSQLDialectCustom() %7B%0A        registerColumnType(Types.BLOB, %22bytea%22);%0A        registerColumnType(Types.LONGVARBINARY, %22bytea%22
 );%0A 
@@ -333,10 +333,15 @@
 ;%0A    %7D%0A
+    %0A
 %7D%0A

Update image content type for Postgres