Integrating Propel clean command
Edit on GitHubThe propel:database:drop
command is used to clean a database of all the tables, indexes, counters and so on. The command invokes the drop
process to delete and re-create the database from scratch.
When working with a remote database, you might have insufficient permissions to invoke the drop
process. To cover the case, the vendor/bin/console propel:tables:drop
command was introduced. The command cleans the database without dropping it.
Integration
Install feature core
Prerequisites
Ensure that the related features are installed:
NAME | VERSION | REQUIRED SUB-FEATURE |
---|---|---|
Spryker Core | 202311.0 | Feature |
1)Install the required modules using Composer
Run the following command(s) to install the required modules:
composer require spryker/propel:"^3.10.0" --update-with-dependencies
Make sure that the following module has been installed:
MODULE | EXPECTED DIRECTORY |
---|---|
Propel | vendor/spryker/propel |
2) Set up behavior
Clean up codeception configuration by deleting SetupHelper
from all codeception configuration files:
- \SprykerTest\Shared\Application\Helper\SetupHelper
Use SprykerTest\Shared\Testify\Helper\DataCleanupHelper
instead to clean up data after each test that can intersect with other tests.
Enable the DatabaseDropTablesConsole
console command in Pyz\Zed\Console\ConsoleDependencyProvider
:
src/Pyz/Zed/Console/ConsoleDependencyProvider.php
<?php
class ConsoleDependencyProvider extends SprykerConsoleDependencyProvider
{
/**
* @param \Spryker\Zed\Kernel\Container $container
*
* @return \Symfony\Component\Console\Command\Command[]
*/
protected function getConsoleCommands(Container $container)
{
$commands = [
...
new DatabaseDropTablesConsole(),
...
- Spryker\Zed\Propel\Communication\Console\DatabaseExportConsole is deprecated.
- Spryker\Zed\Propel\Communication\Console\DatabaseImportConsole is deprecated.
Run vendor/bin/console
and make sure the propel:tables:drop
command is in the list.
Thank you!
For submitting the form