You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm new to Adonis! Looks very promising. I set up a fresh app using: npm init adonisjs@latest my-new-app -- -K=inertia --adapter=svelte --ssr. I chose session for auth, and postgres as database in the prompts.
My system is running Ubuntu 24, so I installed Postgres with sudo apt install postgresql. Then ran sudo systemctl restart postgresql.
When I start Adonis with node ace serve --hmr and go to localhost I get the error: ERROR (47178): database "app" does not exist. My .env file has the defaults:
To ensure I have a user with database access I ran sudo -u postgres psql command and set up root:root access. It's not a connection issue apparently, just the database missing. So I looked through the docs and searched for info, but to no avail.
What is the "correct" way of fixing this? There is no command like this.schema.createDatabase('app') available in Adonis' BaseSchema class or anything.
Is Adonis supposed to set up the database, but it failed in my case? Where do I set the database's collation and encoding?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I'm new to Adonis! Looks very promising. I set up a fresh app using:
npm init adonisjs@latest my-new-app -- -K=inertia --adapter=svelte --ssr
. I chosesession
for auth, andpostgres
as database in the prompts.My system is running Ubuntu 24, so I installed Postgres with
sudo apt install postgresql
. Then ransudo systemctl restart postgresql
.When I start Adonis with
node ace serve --hmr
and go tolocalhost
I get the error:ERROR (47178): database "app" does not exist
. My.env
file has the defaults:To ensure I have a user with database access I ran
sudo -u postgres psql
command and set uproot:root
access. It's not a connection issue apparently, just the database missing. So I looked through the docs and searched for info, but to no avail.What is the "correct" way of fixing this? There is no command like
this.schema.createDatabase('app')
available in Adonis'BaseSchema
class or anything.Is Adonis supposed to set up the database, but it failed in my case? Where do I set the database's collation and encoding?
Thank you for your help!
EDIT: I managed to get it running now with some information from here https://stackoverflow.com/questions/17633422/psql-fatal-database-user-does-not-exist However, maybe the Adonis docs (or Lucid docs) should make a note of the larger question, how to set up a database on your OS, even if out of scope of the project?
Beta Was this translation helpful? Give feedback.
All reactions