'PG::UndefinedTable: ERROR: relation "project_statistics" does not exist' after update to gitlab-ce 8.16.5-ce.1

Summary

Web interface give a 500 (Internal Server Error) on project page after gitlab-ce update to 8.16.5-ce.1

Steps to reproduce

Just visiting the project page causes the issue.

What is the current bug behavior?

(What actually happens)

What is the expected correct behavior?

Should see project page rendered successfully.

Relevant logs and/or screenshots

From /var/log/gitlab/gitlab-rails/production.log:

Started GET "/puppet/controlrepo" for 128.250.146.85 at 2017-02-16 15:31:35 +1100
Processing by ProjectsController#show as HTML
  Parameters: {"namespace_id"=>"puppet", "id"=>"controlrepo"}
Completed 500 Internal Server Error in 86ms (ActiveRecord: 10.0ms)

ActionView::Template::Error (PG::UndefinedTable: ERROR:  relation "project_statistics" does not exist
LINE 5:                WHERE a.attrelid = '"project_statistics"'::re...
                                          ^
:               SELECT a.attname, format_type(a.atttypid, a.atttypmod),
                     pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
                FROM pg_attribute a LEFT JOIN pg_attrdef d
                  ON a.attrelid = d.adrelid AND a.attnum = d.adnum
               WHERE a.attrelid = '"project_statistics"'::regclass
                 AND a.attnum > 0 AND NOT a.attisdropped
               ORDER BY a.attnum
):
    17:     %ul.nav
    18:       %li
    19:         = link_to project_files_path(@project) do
    20:           Files (#{storage_counter(@project.statistics.total_repository_size)})
    21:       %li
    22:         = link_to namespace_project_commits_path(@project.namespace, @project, current_ref) do
    23:           #{'Commit'.pluralize(@project.statistics.commit_count)} (#{number_with_delimiter(@project.statistics.commit_count)})
  app/views/projects/show.html.haml:20:in `block in _app_views_projects_show_html_haml__3901514783277858194_70170198130920'
  app/views/projects/show.html.haml:19:in `_app_views_projects_show_html_haml__3901514783277858194_70170198130920'
  lib/gitlab/middleware/multipart.rb:93:in `call'
  lib/gitlab/request_profiler/middleware.rb:15:in `call'
  lib/gitlab/middleware/go.rb:16:in `call'

Output of checks

(If you are reporting a bug on GitLab.com, write: This bug happens on GitLab.com)

Results of GitLab environment info

System information
System:         Ubuntu 16.04
Current User:   git
Using RVM:      no
Ruby Version:   2.3.3p222
Gem Version:    2.6.6
Bundler Version:1.13.7
Rake Version:   10.5.0
Sidekiq Version:4.2.7

GitLab information
Version:        8.16.5
Revision:       064dab1
Directory:      /opt/gitlab/embedded/service/gitlab-rails
DB Adapter:     postgresql
URL:            https://gitlab.unimelb.edu.au
HTTP Clone URL: https://gitlab.unimelb.edu.au/some-group/some-project.git
SSH Clone URL:  git@gitlab.unimelb.edu.au:some-group/some-project.git
Using LDAP:     no
Using Omniauth: no

GitLab Shell
Version:        4.1.1
Repository storage paths:
- default:      /var/opt/gitlab/git-data/repositories
Hooks:          /opt/gitlab/embedded/service/gitlab-shell/hooks/
Git:            /opt/gitlab/embedded/bin/git

Results of GitLab application Check

Checking GitLab Shell ...

GitLab Shell version >= 4.1.1 ? ... OK (4.1.1)
Repo base directory exists?
default... yes
Repo storage directories are symlinks?
default... no
Repo paths owned by git:git?
default... yes
Repo paths access is drwxrws---?
default... yes
hooks directories in repos are links: ... 
4/1 ... ok
3/3 ... ok
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK
Send ping to redis server: OK
gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... yes
Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking Reply by email ...

Reply by email is disabled in config/gitlab.yml

Checking Reply by email ... Finished

Checking LDAP ...

LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab ...

Git configured with autocrlf=input? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory setup correctly? ... yes
Init script exists? ... skipped (omnibus-gitlab has no init script)
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
projects have namespace: ... 
4/1 ... yes
3/3 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.3.3)
Your git bin path is "/opt/gitlab/embedded/bin/git"
Git version >= 2.7.3 ? ... yes (2.10.2)
Active users: 6

Checking GitLab ... Finished

Possible fixes

(If you can, link to the line of code that might be responsible for the problem)