Search code examples
hanami

How to create production database in hanami?


Hanami has some commands to create a database.

But both db create and db prepare are not available in production environment. http://hanamirb.org/guides/command-line/database/

How can I create a database in production?


Solution

  • It depends.

    We deliberately disabled these commands in production, because they can be potentially destructive and we can't guess where you're gonna deploy your project.

    Is that Heroku? Well, add it via their CLI. Do you use a VPS? Is the database on the same node? Does the Unix user who runs the Ruby process have the permissions to create the database? We can't guess.

    It depends where you're gonna deploy.