从 v6.4 迁移到 v7.2 失败并显示 "Column 'execution_id' cannot be null"

Migration from v6.4 to v7.2 fails with "Column 'execution_id' cannot be null"

运行 在 docker kiwitcms/kiwi:latest (v7.2 digest d757b56bc10c) image based docker 容器中迁移。 在迁移测试用例期间。0010_remove_bug 由于某些数据库约束问题而失败。

这是迁移脚本中的错误还是数据不一致的问题?

Operations to perform:
  Apply all migrations: admin, attachments, auth, bugs, contenttypes, core, django_comments, kiwi_auth, linkreference, management, sessions, sites, testcases, testplans, testruns
Running migrations:
  Applying testcases.0010_remove_bug...Traceback (most recent call last):
  File "/venv/lib/python3.6/site-packages/django/db/backends/mysql/base.py", line 71, in execute
    return self.cursor.execute(query, args)
  File "/venv/lib/python3.6/site-packages/MySQLdb/cursors.py", line 209, in execute
    res = self._query(query)
  File "/venv/lib/python3.6/site-packages/MySQLdb/cursors.py", line 315, in _query
    db.query(q)
  File "/venv/lib/python3.6/site-packages/MySQLdb/connections.py", line 239, in query
    _mysql.connection.query(self, query)
MySQLdb._exceptions.OperationalError: (1048, "Column 'execution_id' cannot be null")

这是迁移脚本中的错误。问题在于,在这些更改之前,您可以将错误直接附加到测试用例,而无需实际执行测试。这导致 case_run_id 字段为 None。

有了新的更改,bug 只能附加到测试执行,它们的 execution_id 字段应该始终有一个值。

你能试试这个补丁吗,让我知道它是否适合你: https://github.com/kiwitcms/Kiwi/pull/1266