Fixed _table_exists function to not use SQL but introspection instead, which fixes problem with Postgres not being able to run this migration