gpt4 book ai didi

mysql - Laravel 5.6 - 不支持 ALGORITHM=COPY

转载 作者:行者123 更新时间:2023-11-30 21:45:34 25 4
gpt4 key购买 nike

我最近将我的项目升级到 Laravel 5.6,将 mysql 升级到 5.7.21,当我运行之前成功的迁移时,我收到了这个错误。

不支持的功能:1846 ALGORITHM=COPY 不受支持。原因:参与外键的列被重命名。

我花了一天的大部分时间进行研究,所以如果你能在这里给我一个提示就太好了。

谢谢!

错误日志

[2018-04-04 20:47:39] local.ERROR: SQLSTATE[0A000]: Feature not supported: 1846 ALGORITHM=COPY is not supported. Reason: Columns participating in a foreign key are renamed. Try ALGORITHM=INPLACE. (SQL: ALTER TABLE sub_category_translations CHANGE placement_id sub_category_id INT NOT NULL) {"exception":"[object] (Illuminate\\Database\\QueryException(code: 0A000): SQLSTATE[0A000]: Feature not supported: 1846 ALGORITHM=COPY is not supported. Reason: Columns participating in a foreign key are renamed. Try ALGORITHM=INPLACE. (SQL: ALTER TABLE sub_category_translations CHANGE placement_id sub_category_id INT NOT NULL) at /Users/andreeastrattner/dev/valet-server/adwonce-v2/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664, Doctrine\\DBAL\\Driver\\PDOException(code: 0A000): SQLSTATE[0A000]: Feature not supported: 1846 ALGORITHM=COPY is not supported. Reason: Columns participating in a foreign key are renamed. Try ALGORITHM=INPLACE. at /Users/andreeastrattner/dev/valet-server/adwonce-v2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:140, PDOException(code: 0A000): SQLSTATE[0A000]: Feature not supported: 1846 ALGORITHM=COPY is not supported. Reason: Columns participating in a foreign key are renamed. Try ALGORITHM=INPLACE. at /Users/andreeastrattner/dev/valet-server/adwonce-v2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:138)
[stacktrace]
#0 /Users/andreeastrattner/dev/valet-server/adwonce-v2/vendor/laravel/framework/src/Illuminate/Database/Connection.php(624): Illuminate\\Database\\Connection->runQueryCallback('ALTER TABLE sub...', Array, Object(Closure))
#1 /Users/andreeastrattner/dev/valet-server/adwonce-v2/vendor/laravel/framework/src/Illuminate/Database/Connection.php(459): Illuminate\\Database\\Connection->run('ALTER TABLE sub...', Array, Object(Closure))
#2 /Users/andreeastrattner/dev/valet-server/adwonce-v2/vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php(88): Illuminate\\Database\\Connection->statement('ALTER TABLE sub...')
#3 /Users/andreeastrattner/dev/valet-server/adwonce-v2/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php(252): Illuminate\\Database\\Schema\\Blueprint->build(Object(Illuminate\\Database\\MySqlConnection), Object(Illuminate\\Database\\Schema\\Grammars\\MySqlGrammar))
#4 /Users/andreeastrattner/dev/valet-server/adwonce-v2/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php(149): Illuminate\\Database\\Schema\\Builder->build(Object(Illuminate\\Database\\Schema\\Blueprint))
#5 /Users/andreeastrattner/dev/valet-server/adwonce-v2/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(221): Illuminate\\Database\\Schema\\Builder->table('sub_category_tr...', Object(Closure))
#6 /Users/andreeastrattner/dev/valet-server/adwonce-v2/database/migrations/2017_11_21_143155_rename_placements_table_to_sub_categories.php(25): Illuminate\\Support\\Facades\\Facade::__callStatic('table', Array)
#7 /Users/andreeastrattner/dev/valet-server/adwonce-v2/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(359): RenamePlacementsTableToSubCategories->up()
#8 /Users/andreeastrattner/dev/valet-server/adwonce-v2/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(366): Illuminate\\Database\\Migrations\\Migrator->Illuminate\\Database\\Migrations\\{closure}()
#9 /Users/andreeastrattner/dev/valet-server/adwonce-v2/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(177): Illuminate\\Database\\Migrations\\Migrator->runMigration(Object(RenamePlacementsTableToSubCategories), 'up')
#10 /Users/andreeastrattner/dev/valet-server/adwonce-v2/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(146): Illuminate\\Database\\Migrations\\Migrator->runUp('/Users/andreeas...', 1, false)
#11 /Users/andreeastrattner/dev/valet-server/adwonce-v2/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(95): Illuminate\\Database\\Migrations\\Migrator->runPending(Array, Array)
#12 /Users/andreeastrattner/dev/valet-server/adwonce-v2/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(70): Illuminate\\Database\\Migrations\\Migrator->run(Array, Array)
#13 [internal function]: Illuminate\\Database\\Console\\Migrations\\MigrateCommand->handle()
#14 /Users/andreeastrattner/dev/valet-server/adwonce-v2/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array)
#15 /Users/andreeastrattner/dev/valet-server/adwonce-v2/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#16 /Users/andreeastrattner/dev/valet-server/adwonce-v2/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Illuminate\\Foundation\\Application), Array, Object(Closure))
#17 /Users/andreeastrattner/dev/valet-server/adwonce-v2/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\\Container\\BoundMethod::call(Object(Illuminate\\Foundation\\Application), Array, Array, NULL)
#18 /Users/andreeastrattner/dev/valet-server/adwonce-v2/vendor/laravel/framework/src/Illuminate/Console/Command.php(183): Illuminate\\Container\\Container->call(Array)
#19 /Users/andreeastrattner/dev/valet-server/adwonce-v2/vendor/symfony/console/Command/Command.php(252): Illuminate\\Console\\Command->execute(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Illuminate\\Console\\OutputStyle))
#20 /Users/andreeastrattner/dev/valet-server/adwonce-v2/vendor/laravel/framework/src/Illuminate/Console/Command.php(170): Symfony\\Component\\Console\\Command\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Illuminate\\Console\\OutputStyle))
#21 /Users/andreeastrattner/dev/valet-server/adwonce-v2/vendor/symfony/console/Application.php(865): Illuminate\\Console\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#22 /Users/andreeastrattner/dev/valet-server/adwonce-v2/vendor/symfony/console/Application.php(241): Symfony\\Component\\Console\\Application->doRunCommand(Object(Illuminate\\Database\\Console\\Migrations\\MigrateCommand), Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#23 /Users/andreeastrattner/dev/valet-server/adwonce-v2/vendor/symfony/console/Application.php(143): Symfony\\Component\\Console\\Application->doRun(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#24 /Users/andreeastrattner/dev/valet-server/adwonce-v2/vendor/laravel/framework/src/Illuminate/Console/Application.php(88): Symfony\\Component\\Console\\Application->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#25 /Users/andreeastrattner/dev/valet-server/adwonce-v2/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(122): Illuminate\\Console\\Application->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#26 /Users/andreeastrattner/dev/valet-server/adwonce-v2/artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#27 {main}
"}
[2018-04-04 20:47:39] local.INFO: QueryException: SQLSTATE[0A000]: Feature not supported: 1846 ALGORITHM=COPY is not supported. Reason: Columns participating in a foreign key are renamed. Try ALGORITHM=INPLACE. (SQL: ALTER TABLE sub_category_translations CHANGE placement_id sub_category_id INT NOT NULL) in /Users/andreeastrattner/dev/valet-server/adwonce-v2/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 664

最佳答案

Doctrine/DBAL 2.7 向 renameColumn() 命令引入了一个错误,现在将您的 composer.json 更改为

"doctrine/dbal": "2.6.3" 

降级你的 Doctrine 版本

编辑:对于仍然遇到此问题的用户,它已在 DBAL 2.7.1 中得到修复,因此您可以安全地升级到该问题而不是降级到 2.6.3。

关于mysql - Laravel 5.6 - 不支持 ALGORITHM=COPY,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49653715/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com