Plugin: SQLite
Platform: Tested in web
Description:
There's a bug in the web plugin code:
for (const upgradeStatement of upgradeStatements) {
if (upgradeStatement.version > oldVersion ||
upgradeStatement.version <= newVersion) {
for (const sql of upgradeStatement.statements) {
await promiser('exec', {
dbId: dbId,
sql: sql,
bind: [],
});
}
}
}
The OR (||) in upgradeStatement.version > oldVersion || upgradeStatement.version <= newVersion means that it's always true for all migrations.
Having reviewed the code of other platforms yet.
How to solve: Change the OR by an AND.
EDIT: Seems Android and iOS implementations are correct, so the problem is only on web.
Plugin: SQLite
Platform: Tested in web
Description:
There's a bug in the web plugin code:
The OR (||) in upgradeStatement.version > oldVersion || upgradeStatement.version <= newVersion means that it's always true for all migrations.
Having reviewed the code of other platforms yet.
How to solve: Change the OR by an AND.
EDIT: Seems Android and iOS implementations are correct, so the problem is only on web.