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

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

I experiencing this when tried to upgrade 3.1.1.4 to 3.1.2.0.

# psql -V
psql (PostgreSQL) 10.6 (Ubuntu 10.6-0ubuntu0.18.04.1.
php -v
PHP 7.3.3-1+ubuntu18.04.1+deb.sury.org+1 (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 v7.3.3-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies