Revision: Wed, 06 Dec 2023 18:32:33 GMT
v3.0 – outdated
This version of the documentation is outdated. Consider upgrading your project to Spiral Framework 3.10
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...

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


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.


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.

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