diff --git a/lib/Doctrine/Migrations/Tools/Console/Command/CurrentCommand.php b/lib/Doctrine/Migrations/Tools/Console/Command/CurrentCommand.php index 90205b7c3..e3c46845c 100644 --- a/lib/Doctrine/Migrations/Tools/Console/Command/CurrentCommand.php +++ b/lib/Doctrine/Migrations/Tools/Console/Command/CurrentCommand.php @@ -5,6 +5,7 @@ namespace Doctrine\Migrations\Tools\Console\Command; use Doctrine\Migrations\Exception\MigrationClassNotFound; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -13,6 +14,7 @@ /** * The CurrentCommand class is responsible for outputting what your current version is. */ +#[AsCommand(name: 'migrations:current', description: 'Outputs the current version')] final class CurrentCommand extends DoctrineCommand { /** @var string|null */ diff --git a/lib/Doctrine/Migrations/Tools/Console/Command/DiffCommand.php b/lib/Doctrine/Migrations/Tools/Console/Command/DiffCommand.php index a400c2a14..0e50940b8 100644 --- a/lib/Doctrine/Migrations/Tools/Console/Command/DiffCommand.php +++ b/lib/Doctrine/Migrations/Tools/Console/Command/DiffCommand.php @@ -10,6 +10,7 @@ use Doctrine\Migrations\Tools\Console\Exception\InvalidOptionUsage; use Doctrine\SqlFormatter\SqlFormatter; use OutOfBoundsException; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; @@ -29,6 +30,7 @@ * The DiffCommand class is responsible for generating a migration by comparing your current database schema to * your mapping information. */ +#[AsCommand(name: 'migrations:diff', description: 'Generate a migration by comparing your current database to your mapping information.')] final class DiffCommand extends DoctrineCommand { /** @var string|null */ diff --git a/lib/Doctrine/Migrations/Tools/Console/Command/DumpSchemaCommand.php b/lib/Doctrine/Migrations/Tools/Console/Command/DumpSchemaCommand.php index 4ca7d08a9..b4afd154e 100644 --- a/lib/Doctrine/Migrations/Tools/Console/Command/DumpSchemaCommand.php +++ b/lib/Doctrine/Migrations/Tools/Console/Command/DumpSchemaCommand.php @@ -7,6 +7,7 @@ use Doctrine\Migrations\Tools\Console\Exception\InvalidOptionUsage; use Doctrine\Migrations\Tools\Console\Exception\SchemaDumpRequiresNoMigrations; use Doctrine\SqlFormatter\SqlFormatter; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; @@ -25,6 +26,7 @@ * * @see Doctrine\Migrations\Tools\Console\Command\RollupCommand */ +#[AsCommand(name: 'migrations:dump-schema', description: 'Dump the schema for your database to a migration.')] final class DumpSchemaCommand extends DoctrineCommand { /** @var string|null */ diff --git a/lib/Doctrine/Migrations/Tools/Console/Command/ExecuteCommand.php b/lib/Doctrine/Migrations/Tools/Console/Command/ExecuteCommand.php index fa74ddece..02d64cda6 100644 --- a/lib/Doctrine/Migrations/Tools/Console/Command/ExecuteCommand.php +++ b/lib/Doctrine/Migrations/Tools/Console/Command/ExecuteCommand.php @@ -6,6 +6,7 @@ use Doctrine\Migrations\Version\Direction; use Doctrine\Migrations\Version\Version; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -24,6 +25,7 @@ /** * The ExecuteCommand class is responsible for executing migration versions up or down manually. */ +#[AsCommand(name: 'migrations:execute', description: 'Execute one or more migration versions up or down manually.')] final class ExecuteCommand extends DoctrineCommand { /** @var string|null */ diff --git a/lib/Doctrine/Migrations/Tools/Console/Command/GenerateCommand.php b/lib/Doctrine/Migrations/Tools/Console/Command/GenerateCommand.php index 1480720b9..3bddf9e4e 100644 --- a/lib/Doctrine/Migrations/Tools/Console/Command/GenerateCommand.php +++ b/lib/Doctrine/Migrations/Tools/Console/Command/GenerateCommand.php @@ -5,6 +5,7 @@ namespace Doctrine\Migrations\Tools\Console\Command; use Exception; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; @@ -17,6 +18,7 @@ /** * The GenerateCommand class is responsible for generating a blank migration class for you to modify to your needs. */ +#[AsCommand(name: 'migrations:generate', description: 'Generate a blank migration class.')] final class GenerateCommand extends DoctrineCommand { /** @var string|null */ diff --git a/lib/Doctrine/Migrations/Tools/Console/Command/LatestCommand.php b/lib/Doctrine/Migrations/Tools/Console/Command/LatestCommand.php index 9583731ee..d51c0b0fb 100644 --- a/lib/Doctrine/Migrations/Tools/Console/Command/LatestCommand.php +++ b/lib/Doctrine/Migrations/Tools/Console/Command/LatestCommand.php @@ -5,6 +5,7 @@ namespace Doctrine\Migrations\Tools\Console\Command; use Doctrine\Migrations\Exception\NoMigrationsToExecute; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -13,6 +14,7 @@ /** * The LatestCommand class is responsible for outputting what your latest version is. */ +#[AsCommand(name: 'migrations:latest', description: 'Outputs the latest version')] final class LatestCommand extends DoctrineCommand { /** @var string|null */ diff --git a/lib/Doctrine/Migrations/Tools/Console/Command/ListCommand.php b/lib/Doctrine/Migrations/Tools/Console/Command/ListCommand.php index b994151f0..268061d5f 100644 --- a/lib/Doctrine/Migrations/Tools/Console/Command/ListCommand.php +++ b/lib/Doctrine/Migrations/Tools/Console/Command/ListCommand.php @@ -9,6 +9,7 @@ use Doctrine\Migrations\Metadata\ExecutedMigration; use Doctrine\Migrations\Metadata\ExecutedMigrationsList; use Doctrine\Migrations\Version\Version; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -20,6 +21,7 @@ /** * The ListCommand class is responsible for outputting a list of all available migrations and their status. */ +#[AsCommand(name: 'migrations:list', description: 'Display a list of all available migrations and their status.')] final class ListCommand extends DoctrineCommand { /** @var string|null */ diff --git a/lib/Doctrine/Migrations/Tools/Console/Command/MigrateCommand.php b/lib/Doctrine/Migrations/Tools/Console/Command/MigrateCommand.php index 37f70d5bc..1d1a76c37 100644 --- a/lib/Doctrine/Migrations/Tools/Console/Command/MigrateCommand.php +++ b/lib/Doctrine/Migrations/Tools/Console/Command/MigrateCommand.php @@ -8,6 +8,7 @@ use Doctrine\Migrations\Exception\NoMigrationsToExecute; use Doctrine\Migrations\Exception\UnknownMigrationVersion; use Doctrine\Migrations\Metadata\ExecutedMigrationsList; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Formatter\OutputFormatter; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -28,6 +29,7 @@ * The MigrateCommand class is responsible for executing a migration from the current version to another * version up or down. It will calculate all the migration versions that need to be executed and execute them. */ +#[AsCommand(name: 'migrations:migrate', description: 'Execute a migration to a specified version or the latest available version.')] final class MigrateCommand extends DoctrineCommand { /** @var string|null */ diff --git a/lib/Doctrine/Migrations/Tools/Console/Command/RollupCommand.php b/lib/Doctrine/Migrations/Tools/Console/Command/RollupCommand.php index d6b987f5a..1c97985d3 100644 --- a/lib/Doctrine/Migrations/Tools/Console/Command/RollupCommand.php +++ b/lib/Doctrine/Migrations/Tools/Console/Command/RollupCommand.php @@ -4,6 +4,7 @@ namespace Doctrine\Migrations\Tools\Console\Command; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -13,6 +14,7 @@ * The RollupCommand class is responsible for deleting all previously executed migrations from the versions table * and marking the freshly dumped schema migration (that was created with DumpSchemaCommand) as migrated. */ +#[AsCommand(name: 'migrations:rollup', description: 'Rollup migrations by deleting all tracked versions and insert the one version that exists.')] final class RollupCommand extends DoctrineCommand { /** @var string|null */ diff --git a/lib/Doctrine/Migrations/Tools/Console/Command/StatusCommand.php b/lib/Doctrine/Migrations/Tools/Console/Command/StatusCommand.php index 032721993..ce710dc91 100644 --- a/lib/Doctrine/Migrations/Tools/Console/Command/StatusCommand.php +++ b/lib/Doctrine/Migrations/Tools/Console/Command/StatusCommand.php @@ -4,6 +4,7 @@ namespace Doctrine\Migrations\Tools\Console\Command; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -11,6 +12,7 @@ * The StatusCommand class is responsible for outputting what the current state is of all your migrations. It shows * what your current version is, how many new versions you have to execute, etc. and details about each of your migrations. */ +#[AsCommand(name: 'migrations:status', description: 'View the status of a set of migrations.')] final class StatusCommand extends DoctrineCommand { /** @var string|null */ diff --git a/lib/Doctrine/Migrations/Tools/Console/Command/SyncMetadataCommand.php b/lib/Doctrine/Migrations/Tools/Console/Command/SyncMetadataCommand.php index 9a0ee48a2..1a0a6085f 100644 --- a/lib/Doctrine/Migrations/Tools/Console/Command/SyncMetadataCommand.php +++ b/lib/Doctrine/Migrations/Tools/Console/Command/SyncMetadataCommand.php @@ -4,9 +4,11 @@ namespace Doctrine\Migrations\Tools\Console\Command; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[AsCommand(name: 'migrations:sync-metadata-storage', description: 'Ensures that the metadata storage is at the latest version.')] final class SyncMetadataCommand extends DoctrineCommand { /** @var string|null */ diff --git a/lib/Doctrine/Migrations/Tools/Console/Command/UpToDateCommand.php b/lib/Doctrine/Migrations/Tools/Console/Command/UpToDateCommand.php index d14b8e6a6..40c70c7f7 100644 --- a/lib/Doctrine/Migrations/Tools/Console/Command/UpToDateCommand.php +++ b/lib/Doctrine/Migrations/Tools/Console/Command/UpToDateCommand.php @@ -9,6 +9,7 @@ use Doctrine\Migrations\Metadata\ExecutedMigration; use Doctrine\Migrations\Metadata\ExecutedMigrationsList; use Doctrine\Migrations\Version\Version; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; @@ -24,6 +25,7 @@ * The UpToDateCommand class outputs if your database is up to date or if there are new migrations * that need to be executed. */ +#[AsCommand(name: 'migrations:up-to-date', description: 'Tells you if your schema is up-to-date.')] final class UpToDateCommand extends DoctrineCommand { /** @var string|null */ diff --git a/lib/Doctrine/Migrations/Tools/Console/Command/VersionCommand.php b/lib/Doctrine/Migrations/Tools/Console/Command/VersionCommand.php index 8556ec32b..2e9b3b04c 100644 --- a/lib/Doctrine/Migrations/Tools/Console/Command/VersionCommand.php +++ b/lib/Doctrine/Migrations/Tools/Console/Command/VersionCommand.php @@ -13,6 +13,7 @@ use Doctrine\Migrations\Version\Direction; use Doctrine\Migrations\Version\ExecutionResult; use Doctrine\Migrations\Version\Version; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -23,6 +24,7 @@ /** * The VersionCommand class is responsible for manually adding and deleting migration versions from the tracking table. */ +#[AsCommand(name: 'migrations:version', description: 'Manually add and delete migration versions from the version table.')] final class VersionCommand extends DoctrineCommand { /** @var string|null */