Well when renaming a database table there is no automatic rename of all referencing tables.
Not only relations needs to be renamed but also keys.
So it is quite a lot and generally not really recommended to do a lot of renaming afterwards because next to the database you will also have to refactor all server connect actions and data bindings using the old name.
Anyway we will see if we can improve at least the database manager part.
So I’m now at a point again where I’m unable to continue using Wappler. Something as simple as trying to change a database name should not make Wappler unusable.
How do I fix the issue without starting from scratch?
You can do renames of tables just fine, but you just have to go and select the new table name also in all reference fields from other tables that reference it. As I said it is not done automatically.
@George I had a similar issue yesterday when I tried to delete a table that was referenced somewhere else. So that failed and afterwards refreshing the schema etc did not get rid of the pending changes. I tried to restart Wappler as well. So the db.json did not get updated. I had to git reset, clear the last migrations inside the db and adjust the db.json.
I had a similar issue (but more because of a mistake on my side, I edit my database data with external tools) and messed up with the structure. At the same time, I had some changes pending in Wappler, and couldn’t apply them, but after a couple of “refreshing the schema” the pending changes went awauy.
But, to be honest, one of the biggest rooms for improvements I see in Refactoring Support, especially in an environment like Wappler where the IDE has almost complete control on the code generation (and the ability to track references)
As @george has specified, you have to use the refresh on the table element. Attempting to use the “refresh schema” at the “db” element or using the refresh button at the top right of the database manager does not refresh the tables.