Wappler Version : 6.8.0
Operating System : macOS 14
Server Model: Node
Database Type: MySQL
Hosting Type: localhost
Expected behavior
I created a new table, "customer_social_media_connections", using Wappler's Database Manager. I applied the changes using Wappler's Database Manager. I then refreshed the schema in Database Manager. Wappler did not show the newly created table in the Table list.
Actual behavior
After refreshing the schema, the newly created table is not displayed in the Table list. I had to log into mysql to see the table.
When trying to select the table in a database update, I see the following, where the table is accessible, but the name is not correctly referenced. The table was NOT named "customer / social_media_connections".
I had to roll back the change, edit the knex file to remove "customer" from the name, save and reapply the change for Database Manager to show me the table in the list and to be able to access it properly from within a database update.
My understanding (and I could be wrong) is that if you name a table with a prefix that is the same name as another table, Wappler thinks you are trying to create a sub-table and creates it accordingly.
In this case, you have an existing table customer and were trying to create a new table customer_social_media_connections so Wappler thought you wanted to create social_media_connections as a sub-table of customer.
Ah, so not necessarily a bug if treating names in this way was intentional. If the intent doesn't go against table naming standard/practices, then I should adapt. If the intent does however go against table naming standards/practices, then the decision to behave in this manner was a poor choice.
I guess it depends. Does the customer_social_media_connections have a connection to the customers table? If so, then it may not be a bad idea to have it as a sub-table.
The new table has a foreign key back to the customer table, but it's certainly not a "sub-type" of the customer entity. Using "customer" in the table name was just personal choice, rather than to say this new table is a sub-type of the properties of customer. I'm ok with the outcome however, and after reading about subtables and their usage, the UI behavior makes sense.