Multi Relations display not always as nested

Wappler Version : 4.8.3
Operating System : Mac OS
Server Model: Node Js
Database Type: My Sql
Hosting Type: Docker

Expected behavior
Database tables should appear correctly nested and named

Actual behavior
Database tables lose nesting levels as the name gets prefixed sometimes and other times it doesn’t.

How to reproduce

Not really sure how to reproduce this all I’m doing is adding multi-relations to sub tables some very nested others only nested one level. Sometimes they show up as named for example posts and then restarting the docker container it goes to blogs_posts and then another restart it might be the same or back to normal. Adding a new multi relation can also cause other multi relations to show up incorrect it’s very random but makes it very hard to work with.

I’m probably just going to use joins and normal tables I think maybe I’m over using sub tables

The sub tables nesting is determined on schema refresh.

If you have a situation that the nesting isn’t determined right, please include the involved table names here and the steps you used to add them

@George
I have the following tables users (normal table) > communities (sub table) > members (multi-relation) the name showing for members is members or community_members in the schema the full name is user_community_members in the database

I do have a table nested further but it’s happening to both

Can you share a screenshot of what you see in the database manager with those tables?

This Is what it is at the moment as you can see here members is named correctly but even with just this a docker restart it can break members.

Also even making simple changes like editing the relation to only CASCADE on delete and not update can break the name etc

This looks all good.

How do you mean it breaks (screenshot)? And when does it get well again?

Let’s say I shut down and clear docker, when I restart it sometimes its members other times it community_members which causes it to show up incorrectly. The naming can also go wrong with just adding a multi relation to begin with or when trying to edit existing multi relations etc.

This is what it looks like when it gets named wrong in the schema:

By cleaning docker you are actually wiping the whole database and then you just reapply the changes?

When does the schema gets it right? After a few refreshes?

The only way I have been able to get it to work is shutting down and relaunching the refresh doesn’t seem to fix the name, also the name of members can break when adding a new change like adding a new multi relation or editing the relations in an existing one.

@George just to add here I’m now trying to work around having a multi relation which only cascades on delete and does nothing on update, this then completely destroys the relation and makes it an integer field.

Also adding more than two relations I can’t get the naming to return to normal no matter what I’ve tried so far when theres 3 or more not sure if these are separate issues or all stemming from the same area

Here’s a quick clip to show what I’m on about with the relation:

Found the problem. Good catch.

The problem was actually in applying minor changes to reference fields, like changing just the on Update. Then the whole foreign key got dropped and that is why it was becoming an invalid sub table and not displayed well.

So it will be solved in the next update.

Also just as note you probably never want to have only cascade on delete and not on update.
On update will probably never happen anyway, but if it does you wan to cascade it as well.

On update means - if somehow you change the primary id - the change should cascade to all related children that use that id and be changed there as well.

8 posts were split to a new topic: Multi reference with multiple references reveals full name after apply

This has been fixed in Wappler 4.9.0

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