diff --git a/lib/Doctrine/Migrations/Tools/Console/Command/CurrentCommand.php b/lib/Doctrine/Migrations/Tools/Console/Command/CurrentCommand.php index 52184a1cd..964ba404e 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 cbf490384..d024be09d 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 23c8480df..24ca85895 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 8bea68fd5..1d1cb76ba 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 c7f06a79e..5d1d15783 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 cadc50a32..d68c47340 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 7d7317e3a..39f4e2b37 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 9bc8f17ff..6e9449b1b 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 de14f1dc1..c7906ea91 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 42d165e2e..ddc7d4cf0 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 e1ec07104..c9f2e6fc1 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 5849fcfc3..a6aa58112 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 d35faad57..457f85e2e 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 */