Hi,
I’m not sure whether this is a bug or a feature, but I’m confused by the differences in behaviour of the options “Refresh Schema” clicked at the database level and the option “Refresh Schema” clicked at the Table Level. I know that bugs have been reported in the past about these functions but I thought they were solved.
I am using mySQL, Windows 10, and NodeJS.
I use Heidi, not Wappler’s database manager function, to manage my database.
WHAT I OBSERVE:
-
Using Heidi, I added more options to an ENUM column of an existing table. The table was updated successfully.
-
I then clicked on Wappler’s DB Manager Refresh Schema at the database level.
-
I looked at the GIT “show changes” and see that the json file that keeps my database info (the one kept in the .wappler/targets/Development/databases folder and named after my database connection) had the section that originally defined the table I changed removed (red highlight) and that a complete new section for the same table was added later in that file (green highlight).
-
The interesting thing is that although the table was “recreated” in that config file, it still had the old options in my enum field. So, Wappler detected that a change happened in that table (I had not dropped it and recreated it, I only changed a column as said above) but did not put it in the new database config file.
-
It was only after I refreshed the table in Wappler’s database manager that the change I made was picked up and shown by the GIT show changes function.
I believe that this may be a bug, or a rather odd behaviour at least.
WHAT I WOULD LIKE TO SEE:
Irrespective of that, I would like to ask why having two refresh functions. If I make many changes to a database not using Wappler’s DB Manager, I don’t think it’s safe to force me to remember all the tables I touched and manually refresh each table one by one so Wappler can have an updated schema. This is not only error prone but also rather inconvenient.
IN ADDITION, TWO ENHANCEMENT REQUESTS
Please help me understand the purpose of the two refresh functions, but with my limited understanding today, I would like to request two enhancements
A) Have just one refresh option, probably placed at the database level, which when executed will pick up EVERY update made to the database.
B) That this function can be configured to execute automatically every time Wappler starts up. This is because I can’t see a reason for not having the database schema up to date at all time.
Many thanks,
Alex