You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
上述2个方法都试过,报错如下
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1101 BLOB/TEXT column 'type' can't have a default value in /www/wwwroot/ssp/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php:193
The text was updated successfully, but these errors were encountered:
bingotl
changed the title
php xcat User createAdmin 数据库迁移报错
vendor/bin/phinx migrate 数据库迁移报错
Jul 26, 2022
Environment 环境
Centos7
MySQL 10.1.44-MariaDB
PHP-7.4
Nginx 1.18.0
Commit
new-feat分支
Bug
vendor/bin/phinx migrate执行后报错
== 20220419163350 NodeRemark: migrating
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1101 BLOB/TEXT column 'remark' can't have a default value in /www/wwwroot/ssp/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php:193
Stack trace:
#0 /www/wwwroot/ssp/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php(193): PDO->exec()
#1 /www/wwwroot/ssp/vendor/robmorgan/phinx/src/Phinx/Db/Util/AlterInstructions.php(108): Phinx\Db\Adapter\PdoAdapter->execute()
#2 /www/wwwroot/ssp/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php(611): Phinx\Db\Util\AlterInstructions->execute()
#3 /www/wwwroot/ssp/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php(972): Phinx\Db\Adapter\PdoAdapter->executeAlterSteps()
#4 /www/wwwroot/ssp/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/AdapterWrapper.php(484): Phinx\Db\Adapter\PdoAdapter->executeActions()
#5 /www/wwwroot/ssp/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/TimedOutputAdapter.php(420): Phinx\Db\Adapter\AdapterWrapper->executeActions()
#6 /www/wwwroot/ssp/vendor/robmorgan/phinx/src/Phinx/Db/Plan/Plan.php(151): Phinx\Db\Adapter\TimedOutputAdapter->executeActions()
#7 /www/wwwroot/ssp/vendor/robmorgan/phinx/src/Phinx/Db/Table.php(715): Phinx\Db\Plan\Plan->execute()
#8 /www/wwwroot/ssp/vendor/robmorgan/phinx/src/Phinx/Db/Table.php(623): Phinx\Db\Table->executeActions()
#9 /www/wwwroot/ssp/databases/migrations/20220419163350_node_remark.php(23): Phinx\Db\Table->update()
#10 /www/wwwroot/ssp/vendor/robmorgan/phinx/src/Phinx/Migration/Manager/Environment.php(108): NodeRemark->change()
#11 /www/wwwroot/ssp/vendor/robmorgan/phinx/src/Phinx/Migration/Manager.php(385): Phinx\Migration\Manager\Environment->executeMigration()
#12 /www/wwwroot/ssp/vendor/robmorgan/phinx/src/Phinx/Migration/Manager.php(359): Phinx\Migration\Manager->executeMigration()
#13 /www/wwwroot/ssp/vendor/robmorgan/phinx/src/Phinx/Console/Command/Migrate.php(122): Phinx\Migration\Manager->migrate()
#14 /www/wwwroot/ssp/vendor/symfony/console/Command/Command.php(298): Phinx\Console\Command\Migrate->execute()
#15 /www/wwwroot/ssp/vendor/symfony/console/Application.php(1024): Symfony\Component\Console\Command\Command->run()
#16 /www/wwwroot/ssp/vendor/symfony/console/Application.php(299): Symfony\Component\Console\Application->doRunCommand()
#17 /www/wwwroot/ssp/vendor/robmorgan/phinx/src/Phinx/Console/PhinxApplication.php(70): Symfony\Component\Console\Application->doRun()
#18 /www/wwwroot/ssp/vendor/symfony/console/Application.php(171): Phinx\Console\PhinxApplication->doRun()
#19 /www/wwwroot/ssp/vendor/robmorgan/phinx/bin/phinx(27): Symfony\Component\Console\Application->run()
#20 /www/wwwroot/ssp/vendor/bin/phinx(115): include('/www/wwwroot/ss...')
#21 {main}
和issues 1463的错误一样,#1463
已经重装系统重新部署环境,出现一样的问题。
SSPanel-Uim/databases/migrations/20220419163350_node_remark.php
$table->addColumn('remark', 'text', array('comment' => '管理员备注', 'after' => 'status', 'default' => '无'))
删掉以下内容再试试
, 'default' => '无'
text改string再执行试试
上述2个方法都试过,报错如下
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1101 BLOB/TEXT column 'type' can't have a default value in /www/wwwroot/ssp/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php:193
The text was updated successfully, but these errors were encountered: