我决定将使用SQLite的工作代码从 Windows 10 移植到 Ubuntu 16.4。此外,在 ARM64 NANOPI NEO4 上。嗯,原来是这样的服务器。一个程序去了。但是第二个,使用SQLite - 好吧,没办法。说数据库结构不好。
pi@NanoPi-NEO4:~/py_codes/scheduler$ python3 main_scheduler.py
2021-04-01 14:51:39,165 - Sheduler.get_sheduled_tasks - INFO - Вызов с args=(<sqlite3.Cursor object at 0x7fa5d6a960>,), kwargs={}
Traceback (most recent call last):
File "main_scheduler.py", line 586, in <module>
sheduled_tasks = get_sheduled_tasks(c)
File "/home/pi/py_codes/scheduler/logger.py", line 20, in wrap_log
result = func(*args, **kwargs)
File "main_scheduler.py", line 112, in get_sheduled_tasks
records = cursor.execute('SELECT * FROM tasks_sheduled WHERE not finished').fetchall()
sqlite3.DatabaseError: malformed database schema (tasks_reports) - default value of column [is_handmade] is not constant
这是主要错误:
sqlite3.DatabaseError: malformed database schema (TABLE_NAME) - default value of column [COLUMN_NAME] is not constant
但我没有更改数据库中的任何内容。刚刚复制并粘贴了文件。
是否需要任何特殊迁移?
以供参考。在 Windows Python 3.8 和 Ubuntu 上 - Python 3.6
列 [is_handmade] 的默认值设置为 False。
文档摘录:
问题出在False中。显然在 Windows 上是可能的,但不是在 Ubuntu 上))在创建默认基数时,我到处都替换了布尔值,从False 到 0,并开始读取)