I was running the system install command including all migrations and ran into the following error:
bin/console system:install --create-database --basic-setup
Prepare installation
Created database `swportal`
Importing base schema.sql
Get collection from directories
migrate Migrations
203/223 [=========================░░░] 91%20:13:02 ERROR [app] Migration: "Shopware\Production\Merchants\Migration\Migration1585212510CustomerDeleteCascade" failed: "An exception occurred while executing ' ALTER TABLE merchant
ADD CONSTRAINT `fk.merchant.customer_id` FOREIGN KEY (`customer_id`)
REFERENCES `customer` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;':
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'swportal.merchant' doesn't exist"
---------- ----------------------
Action Number of migrations
---------- ----------------------
Migrated 219 out of 223
---------- ----------------------
In MigrationCommand.php line 105:
Migration error: An exception occurred while executing ' ALTER TABLE merchant
ADD CONSTRAINT `fk.merchant.customer_id` FOREIGN KEY (`customer_id`)
REFERENCES `customer` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;':
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'swportal.merchant' doesn't exist
Trace:
#0 /home/sebastian/sw-portal/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(166): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException()
#1 /home/sebastian/sw-portal/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(146): Doctrine\DBAL\DBALException::wrapException()
#2 /home/sebastian/sw-portal/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(912): Doctrine\DBAL\DBALException::driverExceptionDuringQuery()
#3 /home/sebastian/sw-portal/src/Merchants/Migration/Migration1585212510CustomerDeleteCascade.php(23): Doctrine\DBAL\Connection->executeQuery()
#4 /home/sebastian/sw-portal/vendor/shopware/core/Framework/Migration/MigrationRuntime.php(47): Shopware\Production\Merchants\Migration\Migration1585212510CustomerDeleteCascade->update()
#5 /home/sebastian/sw-portal/vendor/shopware/core/Framework/Migration/Command/MigrationCommand.php(55): Shopware\Core\Framework\Migration\MigrationRuntime->migrate()
#6 /home/sebastian/sw-portal/vendor/shopware/core/Framework/Migration/Command/MigrationCommand.php(98): Shopware\Core\Framework\Migration\Command\MigrationCommand->getMigrationGenerator()
#7 /home/sebastian/sw-portal/vendor/symfony/console/Command/Command.php(255): Shopware\Core\Framework\Migration\Command\MigrationCommand->execute()
#8 /home/sebastian/sw-portal/src/Command/SystemInstallCommand.php(177): Symfony\Component\Console\Command\Command->run()
#9 /home/sebastian/sw-portal/src/Command/SystemInstallCommand.php(159): Shopware\Production\Command\SystemInstallCommand->runCommands()
#10 /home/sebastian/sw-portal/vendor/symfony/console/Command/Command.php(255): Shopware\Production\Command\SystemInstallCommand->execute()
#11 /home/sebastian/sw-portal/vendor/symfony/console/Application.php(1029): Symfony\Component\Console\Command\Command->run()
#12 /home/sebastian/sw-portal/vendor/symfony/framework-bundle/Console/Application.php(97): Symfony\Component\Console\Application->doRunCommand()
#13 /home/sebastian/sw-portal/vendor/symfony/console/Application.php(272): Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand()
#14 /home/sebastian/sw-portal/vendor/symfony/framework-bundle/Console/Application.php(83): Symfony\Component\Console\Application->doRun()
#15 /home/sebastian/sw-portal/vendor/symfony/console/Application.php(148): Symfony\Bundle\FrameworkBundle\Console\Application->doRun()
#16 /home/sebastian/sw-portal/bin/console(68): Symfony\Component\Console\Application->run()
#17 {main}
system:install [--create-database] [--drop-database] [--basic-setup] [-f|--force] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>