Rails - Database Commands CLI command guides to get started on your next Rails project working with the command rails db

Create a Database

Create a Database

Creates database(s) for the current Rails environment. Rails defaults to the development and test databases, in the off chance RAIL_ENV is not specified.

Create All Databases

Create All Databases

Create a database for all Rails environments.

Drop a Database

Drop a Database

Drops database(s) for the current Rails environment. Rails defaults to the development and test databases, in the off chance RAIL_ENV is not specified.

Drop All Databases

Drop All Databases

Drop databases for all Rails environments.