Revision: Tue, 30 May 2023 16:57:30 GMT
v3.0 – outdated
This version of the documentation is outdated. Consider upgrading your project to Spiral Framework 3.7
Edit this page

Cycle ORM - Console Commands

The Cycle ORM integration provides multiple commands for easier control. You can get help for any of the commands using

php app.php help cycle...

Note
Make sure to enable Spiral\Cycle\Bootloader\CommandBootloader after the cycle bootloaders to activate helper commands.

Migrations

Command Description
migrate Performs one or all the outstanding migrations.
--one Execute only one (first) migration.
migrate:replay Replays (down, up) one or multiple migrations.
--all Replays all the migrations.
migrate:rollback Rolls back (default) or multiple migrations.
--all Rolls back all the executed migrations.
migrate:init Initiates the migrations component (create a migrations table).
migrate:status Gets a list of all available migrations and their statuses.

Database

Command Description
db:list [db] Gets a list of available databases, their tables and records count.
db database name.
db:table <table> Describes a table schema of a specific database.
table A table name (required).
--database A source database.

ORM and Schema

Command Description
cycle Updates (init) the cycle schema from the database and annotated classes.
cycle:migrate Generates the ORM schema migrations.
--run Automatically runs a generated migration.
cycle:render Renders the available CycleORM schemas.
--no-color Displays output without colors.

Note
You can run any cycle command with the -vv flag to see a list of modified tables.