ERROR: type "serial" does not exist when I tried to upgrade to

A database error has occurred: ERROR: type "serial" does not exist

I experiencing this when tried to upgrade to

# psql -V
psql (PostgreSQL) 10.6 (Ubuntu 10.6-0ubuntu0.18.04.1.
php -v
PHP (cli) (built: Mar  7 2019 20:31:49) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.3, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache, Copyright (c) 1999-2018, by Zend Technologies