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

[Error] 执行 vendor/bin/phinx migrate 命令后报错 #1463

Closed
Caiueo opened this issue May 15, 2022 · 5 comments
Closed

[Error] 执行 vendor/bin/phinx migrate 命令后报错 #1463

Caiueo opened this issue May 15, 2022 · 5 comments

Comments

@Caiueo
Copy link

Caiueo commented May 15, 2022

Environment 环境
PHP:7.4
MySQL 5.6.50

Commit
new-feat分支

Error
执行 vendor/bin/phinx migrate 命令后出现如下错误:
’‘’PDOException: SQLSTATE[42000]: Syntax error or access violation: 1101 BLOB/TEXT column 'remark' can't have a default value in /www/wwwroot/site.domain/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php:193
Stack trace:
#0 /www/wwwroot/site.domain/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php(193): PDO->exec()
#1 /www/wwwroot/site.domain/vendor/robmorgan/phinx/src/Phinx/Db/Util/AlterInstructions.php(108): Phinx\Db\Adapter\PdoAdapter->execute()
#2 /www/wwwroot/site.domain/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php(611): Phinx\Db\Util\AlterInstructions->execute()
#3 /www/wwwroot/site.domain/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php(972): Phinx\Db\Adapter\PdoAdapter->executeAlterSteps()
#4 /www/wwwroot/site.domain/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/AdapterWrapper.php(484): Phinx\Db\Adapter\PdoAdapter->executeActions()
#5 /www/wwwroot/site.domain/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/TimedOutputAdapter.php(420): Phinx\Db\Adapter\AdapterWrapper->executeActions()
#6 /www/wwwroot/site.domain/vendor/robmorgan/phinx/src/Phinx/Db/Plan/Plan.php(151): Phinx\Db\Adapter\TimedOutputAdapter->executeActions()
#7 /www/wwwroot/site.domain/vendor/robmorgan/phinx/src/Phinx/Db/Table.php(715): Phinx\Db\Plan\Plan->execute()
#8 /www/wwwroot/site.domain/vendor/robmorgan/phinx/src/Phinx/Db/Table.php(623): Phinx\Db\Table->executeActions()
#9 /www/wwwroot/site.domain/databases/migrations/20220419163350_node_remark.php(23): Phinx\Db\Table->update()
#10 /www/wwwroot/site.domain/vendor/robmorgan/phinx/src/Phinx/Migration/Manager/Environment.php(108): NodeRemark->change()
#11 /www/wwwroot/site.domain/vendor/robmorgan/phinx/src/Phinx/Migration/Manager.php(385): Phinx\Migration\Manager\Environment->executeMigration()
#12 /www/wwwroot/site.domain/vendor/robmorgan/phinx/src/Phinx/Migration/Manager.php(359): Phinx\Migration\Manager->executeMigration()
#13 /www/wwwroot/site.domain/vendor/robmorgan/phinx/src/Phinx/Console/Command/Migrate.php(122): Phinx\Migration\Manager->migrate()
#14 /www/wwwroot/site.domain/vendor/symfony/console/Command/Command.php(298): Phinx\Console\Command\Migrate->execute()
#15 /www/wwwroot/site.domain/vendor/symfony/console/Application.php(1015): Symfony\Component\Console\Command\Command->run()
#16 /www/wwwroot/site.domain/vendor/symfony/console/Application.php(299): Symfony\Component\Console\Application->doRunCommand()
#17 /www/wwwroot/site.domain/vendor/robmorgan/phinx/src/Phinx/Console/PhinxApplication.php(70): Symfony\Component\Console\Application->doRun()
#18 /www/wwwroot/site.domain/vendor/symfony/console/Application.php(171): Phinx\Console\PhinxApplication->doRun()
#19 /www/wwwroot/site.domain/vendor/robmorgan/phinx/bin/phinx(27): Symfony\Component\Console\Application->run()
#20 /www/wwwroot/site.domain/vendor/bin/phinx(112): include('/www/wwwroot/ww...')
#21 {main}‘’‘

Reproduce
配置好数据库,导入数据库 glzjin_all.sql 后,再去执行 vendor/bin/phinx migrate 就报如上错误了

@Caiueo Caiueo changed the title [Error] [Error] 执行 vendor/bin/phinx migrate 命令后报错 May 15, 2022
@Caiueo
Copy link
Author

Caiueo commented May 15, 2022

text改string后再执行也还是报同样的error

@iamsaltedfish
Copy link
Collaborator

换mysql8或mariadb吧

@iamsaltedfish
Copy link
Collaborator

删掉以下内容再试试
, 'default' => '无'

@Caiueo
Copy link
Author

Caiueo commented May 15, 2022

换到 mariadb 后解决了,谢谢

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

2 participants