Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Db has to be emptied first #21

Open
bartoszkubicki opened this issue Mar 22, 2024 · 4 comments
Open

Db has to be emptied first #21

bartoszkubicki opened this issue Mar 22, 2024 · 4 comments

Comments

@bartoszkubicki
Copy link
Contributor

bartoszkubicki commented Mar 22, 2024

Database has to be emptied first + constant is missing

Starting the Database import
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'admin_adobe_ims_webapi' already exists
Undefined constant Symfony\Component\Console\Command\Command::SUCCESS#0 /var/www/html/vendor/symfony/console/Command/Command.php(255): Jh\StrippedDbProvider\Console\ImportFromRemoteCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Jh\StrippedDbProvider\Console\ImportFromRemoteCommand\Interceptor->___callParent('run', Array)
#3 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Jh\StrippedDbProvider\Console\ImportFromRemoteCommand\Interceptor->Magento\Framework\Interception\{closure}(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /var/www/html/generated/code/Jh/StrippedDbProvider/Console/ImportFromRemoteCommand/Interceptor.php(77): Jh\StrippedDbProvider\Console\ImportFromRemoteCommand\Interceptor->___callPlugins('run', Array, Array)
#5 /var/www/html/vendor/symfony/console/Application.php(1021): Jh\StrippedDbProvider\Console\ImportFromRemoteCommand\Interceptor->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 /var/www/html/vendor/symfony/console/Application.php(275): Symfony\Component\Console\Application->doRunCommand(Object(Jh\StrippedDbProvider\Console\ImportFromRemoteCommand\Interceptor), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /var/www/html/vendor/magento/framework/Console/Cli.php(116): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /var/www/html/vendor/symfony/console/Application.php(149): Magento\Framework\Console\Cli->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /var/www/html/bin/magento(23): Symfony\Component\Console\Application->run()
#10 {main}

Is there any clever workaround for it? Or separate command could be added to override existing db dynamically?

@megham2908
Copy link

Database has to be emptied first + constant is missing

Starting the Database import
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'admin_adobe_ims_webapi' already exists
Undefined constant Symfony\Component\Console\Command\Command::SUCCESS#0 /var/www/html/vendor/symfony/console/Command/Command.php(255): Jh\StrippedDbProvider\Console\ImportFromRemoteCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Jh\StrippedDbProvider\Console\ImportFromRemoteCommand\Interceptor->___callParent('run', Array)
#3 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Jh\StrippedDbProvider\Console\ImportFromRemoteCommand\Interceptor->Magento\Framework\Interception\{closure}(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /var/www/html/generated/code/Jh/StrippedDbProvider/Console/ImportFromRemoteCommand/Interceptor.php(77): Jh\StrippedDbProvider\Console\ImportFromRemoteCommand\Interceptor->___callPlugins('run', Array, Array)
#5 /var/www/html/vendor/symfony/console/Application.php(1021): Jh\StrippedDbProvider\Console\ImportFromRemoteCommand\Interceptor->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 /var/www/html/vendor/symfony/console/Application.php(275): Symfony\Component\Console\Application->doRunCommand(Object(Jh\StrippedDbProvider\Console\ImportFromRemoteCommand\Interceptor), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /var/www/html/vendor/magento/framework/Console/Cli.php(116): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /var/www/html/vendor/symfony/console/Application.php(149): Magento\Framework\Console\Cli->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /var/www/html/bin/magento(23): Symfony\Component\Console\Application->run()
#10 {main}

Is there any clever workaround for it? Or separate command could be added to override existing db dynamically?

Can we add --add-drop-table command when we dump mysql and in this way there would be an option that is used to write a DROP TABLE statement before each CREATE TABLE statement and we won't face this issue Base table or view already exists

@bartoszkubicki
Copy link
Contributor Author

I wouldn't do that, I dont know how it will work with permissions and so on. Maybe dump should contain additional statements dropping table before they are imported?

@JamelleG
Copy link
Contributor

Maybe dump should contain additional statements dropping table before they are imported?

I think that's what @megham2908 is mentioning the --add-drop-table would add these statements to the dump unless I'm misunderstanding, I believe this is already implemented from at least version 1.1

['skip-definer' => true, 'add-drop-table' => true, 'skip-triggers' => true]

@megham2908
Copy link

Maybe dump should contain additional statements dropping table before they are imported?

I think that's what @megham2908 is mentioning the --add-drop-table would add these statements to the dump unless I'm misunderstanding, I believe this is already implemented from at least version 1.1

['skip-definer' => true, 'add-drop-table' => true, 'skip-triggers' => true]

Yes I'm going to test this on my local, I checked in the upgraded version --add-drop-table has been already added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants