Revision: Thu, 25 Apr 2024 11:06:46 GMT
v2.14 – outdated
This version of the documentation is outdated. Consider upgrading your project to Spiral Framework 3.12
Edit this page

Cycle ORM - Console Commands

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 active helper commands.

Migrations

Command Description
migrate Perform one or all outstanding migrations.
--one Execute only one (first) migration.
migrate:replay Replay (down, up) one or multiple migrations.
--all Replay all migrations.
migrate:rollback Rollback one (default) or multiple migrations.
--all Rollback all executed migrations.
migrate:init Init migrations component (create migrations table).
migrate:status Get list of all available migrations and their statuses.

Database

Command Description
db:list [db] Get list of available databases, their tables and records count.
db database name.
db:table <table> Describe table schema of specific database.
table Table name (required).
--database Source database.

ORM and Schema

Command Description
cycle Update (init) cycle schema from database and annotated classes.
cycle:migrate Generate ORM schema migrations.
--run Automatically run generated migration.
cycle:render Render available CycleORM schemas.
--no-color Display output without colors.

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