dragotin / kraft

Kraft helps to handle your daily quotes and invoices in your small business.
http://volle-kraft-voraus.de
GNU General Public License v2.0
56 stars 18 forks source link

Bug: Creation of a new database fails during initial setup while migrating it #162

Closed noseshimself closed 2 years ago

noseshimself commented 2 years ago

Version: master of 20220720

Environment: kraftrc:

[WindowSizes]

[document]
DefaultTaxType=1
ShowDocumentLocale=true

[reporting]
PdfOutputDir=/home/ap/NextCloud/BNC/Kraft/PDF

[system]
DoXmlArchive=true
XmlArchivePath=/home/ap/NextCloud/BNC/Kraft/Archiv
mailUA=thunderbird
oldmailUA=xdg

[userdefaults]
DateFormat=ISO
InsertTemplChapterName=Sonstige
doctype=Rechnung
greeting=Anrede

kraftdatabaserc:

[Sqlite settings]
DbFileOld=/home/ap/.local/share/kraft/kraft.db
DbFile=/home/ap/iNextCloud/BNC/Kraft/database/kraft.db
DbPathnotworking=/home/ap/NextCloud/BNC/Kraft/database/

[database selection]
DbDriver=QSQLITE
ap@devel:~/NextCloud/BNC

Screenshot 2022-07-27 18 05 08

Console output up to that point:

Appending 10 commands for version 24
11  commands performed well, version is  2 , listversion: 2
2  commands performed well, version is  3 , listversion: 3
27  commands performed well, version is  4 , listversion: 4
20  commands performed well, version is  5 , listversion: 5
0  commands performed well, version is  6 , listversion: 6
0  commands performed well, version is  7 , listversion: 7
7  commands performed well, version is  8 , listversion: 8
1  commands performed well, version is  9 , listversion: 9
17  commands performed well, version is  10 , listversion: 10
0  commands performed well, version is  11 , listversion: 11
3  commands performed well, version is  12 , listversion: 12
0  commands performed well, version is  13 , listversion: 13
3  commands performed well, version is  14 , listversion: 14
0  commands performed well, version is  15 , listversion: 15
5  commands performed well, version is  16 , listversion: 16
2  commands performed well, version is  17 , listversion: 17
3  commands performed well, version is  18 , listversion: 18
8  commands performed well, version is  19 , listversion: 19
4  commands performed well, version is  20 , listversion: 20
2  commands performed well, version is  21 , listversion: 21
2  commands performed well, version is  22 , listversion: 22
###### Failed SQL Command  "ALTER TABLE Catalog DROP COLUMN lastUsed;" :  "near \"DROP\": syntax error Der Befehl konnte nicht ausgeführt werden"

###### Failed SQL Command  "ALTER TABLE Catalog DROP COLUMN useCounter;" :  "near \"DROP\": syntax error Der Befehl konnte nicht ausgeführt werden"

Only performned  2  out of  4

After quitting Kraft and starting it again I'm getting Screenshot 2022-07-27 18 34 29 and the database setup is retried (and will fail of course again). I can abort the setup and work with that database but it's getting annoying to see it on every start.

dragotin commented 2 years ago

Aha, you're using a rather old sqlite version, ALTER TABLE DROP COLUMN is only supported in sqlite versions starting from 3.35: https://sqlite.org/changes.html#version_3_35_0

I will remove the drop column statement as robustness is more important than an unused column in this case.

dragotin commented 2 years ago

Should be fixed with the referenced commit.