When deploying a Phoenix app, are we supposed to make another database, separate from the `dev` and `test` ones in Postgres?

In the Phoenix deployment docs, to set the production database variables, they give the following command:

export DATABASE_URL=ecto://USER:PASS@HOST/database

Using Postgres, is this database supposed to be something we manually create and assign a user and pass?

As of right now, I have MyWebApp_dev and MyWebApp_test databases.

1 Like

Yes if you are deploying your app on a server you have full controll on. For example that is what I did with a VPS I have for a website. I installed myself postgresql then create a user, a database with a password and configured the Phoenix app to connect to that database.

With some other hosting solutions you won’t have to create the database database yourself. You can opt for a server with a pre-configured database and they will just give you all the needed informations.

So it depends on how you are deploying your apps.

If your question is about wether you can use a single database for all environments (test, dev, prod), of course you can, but you don’t want to mix for example testing data with production data.