Wappler Version: 6.0 Beta 16
Operating System: Windows 11
Server Model: Capacitor / Electron
Database Type: SQLite
Electron Package json:
“@capacitor-community/electron”: “^4.1.2”,
“@capacitor-community/sqlite”: “^4.8.0”,
“@capacitor/cli”: “^5.5.1”,
“@capacitor/core”: “^5.5.1”,
I’m not sure how to get past this error. I had an existing SQLite db located in the CapacitorDatabases directory that had a typo in one of the columns. I updated the column in Wappler, but the change was not reflecting in the installed apps db, so I renamed the db, then moved it to another folder hoping that it would create a new db. Instead I’m getting this error message. This db was created months ago, so it appears something may have changed during an update to one of the related files causing new updates to not alter the db.
If I put the old DB file back into the folder, then the error goes away, but I still have the column that’s incorrectly named, so I’m not sure how to correct it.
It doesn’t look like any updates (additions, deletion, renames) of fields are added to the existing db of the installed Electron app. Even uninstalling and reinstalling has no effect.
I’ve tested building a completely new project, adding new fields and new tables to sqlite, rebuliding and packing electron, and installing new the electron app on machine. It all appears to work correctly, so the issue seems to be related to my older project, but I’m not sure what could be outdated and causing the db to not get updated. I can even delete/remove the new db file and Electron will recreate a new one in the CapacitorDatabases directory without any issues.
Thanks @jmartland22! Fortunately I’m able to build/pack the app, it’s during runtime that I’m experiencing the issue. Either way I did test 5.4.0, but it didn’t appear to help for this issue.
Here’s a slightly different error. I experimented with creating a new database connection. With one simple table (email) containing two fields. I also created a test page with nothing on it except for an App Flow which inserts a record into the db and then performs a query to get the records. I’m not even triggering the flow, so the only event that’s happening on the page is it’s attempting to initialize the db.
Ok, got past the most recent error by comparing against another completely new project. The issue was that I had “Use SQLite” enabled in Project Options. I’m not sure what that is supposed to do, but disabling it fixed the Cannot read properties of undefined (reading 'addUpgradeStatement')
At the moment, this appears to be due to a corrupted database structure created in the Database Manager. I have no idea what was corrupted, or how, since it was built entirely using Wappler and worked well in SQLite for some period of time and also worked with PouchDB more recently, at least the structure.