Models CLI

Installation

To install the CLI use the following command: $ cargo install models-cli

Usage

There are three main commands: database, generate and migrate.

database

it can be abbreviated as db. It includes the subcomands: * create: Creates the database specified in your DATABASEURL. * drop: Drops the database specified in your DATABASEURL. * reset: Drops the database specified in your DATABASEURL, re-creates it, and runs any pending migrations. * setup: Creates the database specified in your DATABASEURL and runs any pending migrations.

generate

It is used to generate migrations. It can be used to generate down migrations as well if the -r flag is enabled. The --source variable can be used to specify the migrations directory. The --table variable can be used to filter the names of the tables to target in the generation.

migrate