fix: changing PostgreSQL commands that create the user and database.

felipewnp
2025-09-18 18:20:10 -03:00
parent 4ba478f0e2
commit 5beb9c4193

@@ -28,15 +28,13 @@ A complete list of codes can be found on [Wikipedia page for percent encoding](h
An easy way of migrating from SQLite to PostgreSQL or to MySQL exists, but please, note that you **are using this at your own risk and you are strongly advised to backup your installation and data!**. This is **unsupported** and has not been robustly tested. An easy way of migrating from SQLite to PostgreSQL or to MySQL exists, but please, note that you **are using this at your own risk and you are strongly advised to backup your installation and data!**. This is **unsupported** and has not been robustly tested.
1. Create an new (empty) database for vaultwarden: 1. Create a new database user:
```sql
CREATE DATABASE vaultwarden;
```
2. Create a new database user and grant rights to database:
```sql ```sql
CREATE USER vaultwarden WITH ENCRYPTED PASSWORD 'yourpassword'; CREATE USER vaultwarden WITH ENCRYPTED PASSWORD 'yourpassword';
GRANT CONNECT ON DATABASE vaultwarden TO vaultwarden; ```
ALTER SCHEMA public OWNER TO vaultwarden; 2. Create a new (empty) database for vaultwarden, setting the user as the database owner:
```sql
CREATE DATABASE vaultwarden OWNER vaultwarden;
``` ```
3. Configure vaultwarden and start it, so diesel can run migrations and set up the schema properly. Do not do anything else. 3. Configure vaultwarden and start it, so diesel can run migrations and set up the schema properly. Do not do anything else.
4. Stop vaultwarden. 4. Stop vaultwarden.
@@ -61,15 +59,13 @@ load database
Please, note that you **are using this at your own risk and you are strongly advised to backup your installation and data!**. This is **unsupported** and has not been robustly tested. Please, note that you **are using this at your own risk and you are strongly advised to backup your installation and data!**. This is **unsupported** and has not been robustly tested.
1. Create a new (empty) database for vaultwarden: 1. Create a new database user:
```sql
CREATE DATABASE vaultwarden;
```
2. Create a new database user and grant rights to database:
```sql ```sql
CREATE USER vaultwarden WITH ENCRYPTED PASSWORD 'yourpassword'; CREATE USER vaultwarden WITH ENCRYPTED PASSWORD 'yourpassword';
GRANT ALL ON DATABASE vaultwarden TO vaultwarden; ```
GRANT all privileges ON database vaultwarden TO vaultwarden; 2. Create a new (empty) database for vaultwarden, setting the user as the database owner:
```sql
CREATE DATABASE vaultwarden OWNER vaultwarden;
``` ```
3. Configure vaultwarden and start it, so diesel can run migrations and set up the schema properly. Do not do anything else. 3. Configure vaultwarden and start it, so diesel can run migrations and set up the schema properly. Do not do anything else.
4. Stop vaultwarden. 4. Stop vaultwarden.