docs: added a note about db user create privilege (#4584)

* docs: added a note about db user create privilege

* added troubleshooting section
This commit is contained in:
Shahed Nasser
2023-07-21 17:39:43 +03:00
committed by GitHub
parent d22569f379
commit 9748d8b7c0
5 changed files with 17 additions and 3 deletions

View File

@@ -70,6 +70,10 @@ DATABASE_URL=<YOUR_DATABASE_URL>
Where `<YOUR_DATABASE_URL>` 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:

View File

@@ -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
<ConnectionErrorSection />
<ConnectionErrorSection />
---
## Database User Privileges
<PrivilegesSection />

View File

@@ -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).

View File

@@ -1876,7 +1876,7 @@ module.exports = {
{
type: "doc",
id: "troubleshooting/database-error",
label: "Database SASL Error",
label: "Database Errors",
},
{
type: "doc",

View File

@@ -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"
)}
>
<Heading as="h1" className="!tw-mb-0">
<Heading as="h1" className={clsx(badge && "!tw-mb-0")}>
{syntheticTitle}
{badge && (
<Badge