From 9748d8b7c02d0dc4dc7989a17442eebd19184ceb Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Fri, 21 Jul 2023 17:39:43 +0300 Subject: [PATCH] docs: added a note about db user create privilege (#4584) * docs: added a note about db user create privilege * added troubleshooting section --- docs/content/development/backend/configurations.md | 4 ++++ docs/content/troubleshooting/database-error.mdx | 9 ++++++++- .../troubleshooting/database-errors/_privileges.md | 3 +++ www/docs/sidebars.js | 2 +- www/docs/src/theme/DocItem/Content/index.tsx | 2 +- 5 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 docs/content/troubleshooting/database-errors/_privileges.md diff --git a/docs/content/development/backend/configurations.md b/docs/content/development/backend/configurations.md index b8b94f1192..a6e4161c63 100644 --- a/docs/content/development/backend/configurations.md +++ b/docs/content/development/backend/configurations.md @@ -70,6 +70,10 @@ DATABASE_URL= Where `` is the URL of your PostgreSQL database. +#### Database User Privileges + +The database user that you use must have create privileges. If you're using the `postgres` superuser, then it should have these privileges by default. Otherwise, make sure to grant your user create priviliges. You can learn how to do that in [PostgreSQL's documentation](https://www.postgresql.org/docs/current/ddl-priv.html). + ### Changing PostgreSQL Schema By default, the `public` schema is used in PostgreSQL. You can change it to use a custom schema by passing the `search_path` option in the database URL. For example: diff --git a/docs/content/troubleshooting/database-error.mdx b/docs/content/troubleshooting/database-error.mdx index a797a33c1d..2e73f835aa 100644 --- a/docs/content/troubleshooting/database-error.mdx +++ b/docs/content/troubleshooting/database-error.mdx @@ -4,6 +4,7 @@ title: 'Database Errors' import SaslSection from './database-errors/_sasl.md' import ConnectionErrorSection from './database-errors/_connection-error.md' +import PrivilegesSection from './database-errors/_privileges.md' ## Error: SASL: SCRAM-SERVER-FIRST-MESSAGE: Client password must be a string @@ -13,4 +14,10 @@ import ConnectionErrorSection from './database-errors/_connection-error.md' ## Error: connect ECONNREFUSED ::1:5432 - \ No newline at end of file + + +--- + +## Database User Privileges + + \ No newline at end of file diff --git a/docs/content/troubleshooting/database-errors/_privileges.md b/docs/content/troubleshooting/database-errors/_privileges.md new file mode 100644 index 0000000000..3ae0b9d1e7 --- /dev/null +++ b/docs/content/troubleshooting/database-errors/_privileges.md @@ -0,0 +1,3 @@ +The database user you use in the `database_url` Medusa backend configuration must have create privileges. Otherwise, you'll face problems when running migrations. + +If you're using the `postgres` superuser, then it should have these privileges by default. Otherwise, make sure to grant your user create privileges. You can learn how to do that in [PostgreSQL's documentation](https://www.postgresql.org/docs/current/ddl-priv.html). diff --git a/www/docs/sidebars.js b/www/docs/sidebars.js index fe68be4a7a..147daf4d88 100644 --- a/www/docs/sidebars.js +++ b/www/docs/sidebars.js @@ -1876,7 +1876,7 @@ module.exports = { { type: "doc", id: "troubleshooting/database-error", - label: "Database SASL Error", + label: "Database Errors", }, { type: "doc", diff --git a/www/docs/src/theme/DocItem/Content/index.tsx b/www/docs/src/theme/DocItem/Content/index.tsx index 7181e45410..21d234bd4a 100644 --- a/www/docs/src/theme/DocItem/Content/index.tsx +++ b/www/docs/src/theme/DocItem/Content/index.tsx @@ -42,7 +42,7 @@ export default function DocItemContent({ children }: Props): JSX.Element { badge && "md:tw-flex md:tw-items-center md:tw-gap-0.5 tw-mb-2" )} > - + {syntheticTitle} {badge && (