kopia lustrzana https://dev.funkwhale.audio/funkwhale/funkwhale
1.6 KiB
1.6 KiB
6. Set up your database
Funkwhale uses a PostgreSQL database to store information. Follow these steps to set up your database.
-
Install PostgreSQL and the
postgresql-contrib
package. This package contains extra features that Funkwhale uses.sudo apt-get install postgresql postgresql-contrib
-
Once you've installed PostgreSQL, launch a
psql
shell as thepostgres
user to set up your database.sudo -u postgres psql
-
Create your Funkwhale database.
CREATE DATABASE funkwhale WITH ENCODING 'utf8';
-
Create a user for Funkwhale. This user needs all privileges so it can manage the database.
CREATE USER funkwhale; GRANT ALL PRIVILEGES ON DATABASE funkwhale TO funkwhale;
-
Once you're finished, exit the shell
exit
-
Run the following commands to create extra extensions for the
funkwhale
database.sudo -u postgres psql funkwhale -c 'CREATE EXTENSION "unaccent";' sudo -u postgres psql funkwhale -c 'CREATE EXTENSION "citext";'
-
Your database is ready to be populated! Use the
manage.py
script to create the database structure.cd /srv/funkwhale/api poetry run python manage.py migrate
You may see the following warning when applying migrations:
```{code}
"Your models have changes that are not yet reflected in a migration, and so won't be applied."
```
You can safely ignore this warning.
That's it! You've finished setting up your database.