# Getting issue with Database Migrations

**URL:** https://meta.discourse.org/t/getting-issue-with-database-migrations/100381
**Category:** Self-hosting
**Created:** [October 24, 2018, 7:02pm UTC](https://meta.discourse.org/t/getting-issue-with-database-migrations/100381 "2018-10-24T19:02:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Afx\_Afzaal](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Afx\_Afzaal](https://meta.discourse.org/u/Afx_Afzaal)
#### Post date: [October 24, 2018, 7:02pm UTC](https://meta.discourse.org/t/getting-issue-with-database-migrations/100381/1 "2018-10-24T19:02:15Z")

</div>

Hi , I am getting an error when i run command

`bundle exec rake db:create db:migrate`

```
ERROR: syntax error at or near "NOT"
LINE 1: CREATE SCHEMA IF NOT EXISTS discourse_functions;

```

PostGRESQL Version : 9.2.24  
OS : Centos 7

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [October 24, 2018, 7:05pm UTC](https://meta.discourse.org/t/getting-issue-with-database-migrations/100381/2 "2018-10-24T19:05:38Z")

</div>

You need to upgrade Postgres. You can search here, but I think that 9.6 is required.

---

<div class="post-metadata">

### Author: ![Afx\_Afzaal](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Afx\_Afzaal](https://meta.discourse.org/u/Afx_Afzaal)
#### Post date: [October 24, 2018, 7:48pm UTC](https://meta.discourse.org/t/getting-issue-with-database-migrations/100381/3 "2018-10-24T19:48:24Z")

</div>

Thanks Man ! It Worked ! Although working with PostgreSQL upgrades etc is a pain. Thanks ! @pfaffman
