我在应用架构迁移期间遇到此错误
{"timestamp":"2023-01-11 11:53:09.043 Z","level":"fatal","msg":"Failed to apply database migrations.","caller":"sqlstore/store.go:169","error":"driver: mysql, message: failed when applying migration, command: apply_migration, originalError: Error 1845: LOCK=NONE is not supported for this operation. Try LOCK=SHARED., query: \n\nSET @preparedStatement = (SELECT IF(\n (\n SELECT COUNT(*) FROM INFORMATION_SCHEMA.STATISTICS\n WHERE table_name = 'Posts'\n AND table_schema = DATABASE()\n AND index_name = 'idx_posts_create_at_id'\n ) > 0,\n 'SELECT 1;',\n 'CREATE INDEX idx_posts_create_at_id on Posts(CreateAt, Id) LOCK=NONE;'\n));\n\nPREPARE createIndexIfNotExists FROM @preparedStatement;\nEXECUTE createIndexIfNotExists;\nDEALLOCATE PREPARE createIndexIfNotExists;\n\n"}
我是否必须像往常一样应用新模式和使用应用程序?
谢谢
我通过
LOCK=NONE
从包含它的数据库查询中删除来解决了一个问题。