update SQL schema to make it work on postgres