Database Manager: changing the name of a table breaks the database manager

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.

The change of the name failed. I don’t care about all of the references at the moment.

Could you be more specific on that? What error did you got? We have to know the exact error in order to investigate further.

I’ll have to try to replicate the issue since there’s no log of errors?

Maybe this is another area for Wappler to improve?

yes or if those changes are still pending, just try to apply them again and inspect the generated file next to also reporting the exact error.

When I try to apply the changes it says there’s nothing to do.

Maybe try to refresh the database schema, select the tables node and choose refresh schema from the context menu.

Please see my DM.

To discard all pending changes you need to refresh the schema for the tables from the context menu.

image

@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.

This is very confusing, but it solved my issue.

1 Like

That did not work for me but glad it did for you.

Will improve the refresh from the toolbar to be also for the selected connection and force you to select one if you haven’t

2 Likes

Fixed in Wappler 5.4

This topic was automatically closed after 2 days. New replies are no longer allowed.