Not posting as a bug yet as i would prefer to understand what is happening here first.
When doing tutorials i often re-use existing projects but sometimes make some small changes to add a bit of variety
I set up a project using sqlite as a local database (used in orangehost video).
I experienced no problems with the Database Manager
In a later project i switched that to using a cloud (docker) local database (done through interface, no json hacking!) for another video
Again, no problems
Later I switched back to sqlite (via interface) and all seemed to be working as expected, i could add/ remove tables etc without errors
Then I tried adding a reference field and got this error message
it appears Knex is trying to connect to the old (removed) mysqlDBlocal connection rather than the defined sqlite connection.
I have scoured every .json file in the .wappler and app folder and can not find any reference to mysqlDBlocal.
Anyone any idea where knex gets it's connection name from so i can investigate further to ascertain if a bug or me doing something wrong.
Add/ remove tables acts on sqlite table (docker is not actually running at this time), it only appears that the reference fields are effected.
The knex file
exports.up = function(knex) {
return knex.schema
.table('mysqlDBlocal.people', async function (table) {
table.integer('add_ref').unsigned();
table.foreign('add_ref').references('person_id').inTable('mysqlDBlocal.address');
})
};
exports.down = function(knex) {
return knex.schema
.table('mysqlDBlocal.people', async function (table) {
table.dropForeign('add_ref');
table.dropColumn('add_ref');
})
};
it appears this code should not be there (it is not in any other knex files, for example delete/add tables etc)
.table('mysqlDBlocal.people'