Subtable disappears in database manager

Guys,
I’m working on adding a subtable “traitement_intervention” to my table “interventions”. This sub table needs also 2 sub_tables “sub_images” and “sub_collaborateurs”…
My Wappler Database Manager is getting crazy… my changes are applied.
My sub tables disappeared - sometimes appeared.
Wappler indicates there are change if I reboot both computer and wappler while my changes are already applied just on clicking on any table from the list.
This morning some subtable were usable in nested queries… but not displayed.
Right now there are not displayed anymore…
I don’t know how to explain more precisely cause I have several and strange behaviours - It’s changing every time I reboot Wappler, Docker or Mac…
Really need help - I stuck with it and can’t pursue my devs.
Thanks
Sylvain

(Wappler 5.8.1 / Mac Book Pro 13.4 / Bootstrap 5 / Node JS Debian 11 Bullseye / PostgreSQL 11.1.x)

Hi,
Since.
I succeeded in opening Wappler with a stable setup and without Changes to apply I did not “created”.
Then I decided to recreate the sub table I need with differents strange results (and results change depending on tries):

  • fields are all displayed only in advanced mode
  • sub tables became multi-relation tables sometimes
  • sub table became table tables on root level…
  • sometimes some reference fields are not renamed as I setted them

I thought maybe I have too many tables in my project so I decided to create a brand new web project using Wappler data sample to test the same table/sub_table creation process : 1 main root level table > 1 sub table > 2 sub tables

I got the same results. I mean too many random display / settings… but not the one I setted up, and the stable on I expect… rebooting Wappler or Mac I get differents DB schema… sometimes sub table… sometimes multi relational, sometimes changes to apply who shouldn’t exist.

IMO there is something very unconfident with the 5.8.2 DataBase Manager tool.
Finally can’t set the tables I need to create in my working project - still stuck - lost 1 working day.

Thanks Wappler team (@Teodor @George) for your feedback.
Team and customers are waiting after me for new features I can’t work on without modifying my DB schema.

As I say, the problem is not only with my project but also with a brand new project with Wappler Sample Data.
Thanks.

Sylvain

Screenshot from a brand new testing project with PostgreSQL 14.8.x

  1. I create a brand new project with sample data : Nodes JS + PostGreSQL 14.8.x

  2. I create in User table 1 Sub table + 2 sub tables using Database Manager in a classical way

  1. I apply Changes (36)

  2. The result

  1. The Change file

    exports.up = function(knex) {
    return knex.schema
    .createTable(‘user_sub_table’, async function (table) {
    table.increments(‘id_st’);
    table.string(‘test_field’);
    table.integer(‘creator’).unsigned();
    table.foreign(‘creator’).references(‘id’).inTable(‘users’).onUpdate(‘CASCADE’).onDelete(‘CASCADE’);
    table.timestamp(‘created’);
    table.integer(‘user_id’).unsigned();
    table.foreign(‘user_id’).references(‘id’).inTable(‘users’).onUpdate(‘CASCADE’).onDelete(‘CASCADE’);
    })
    .createTable(‘user_sub_table_s_sub_t1’, async function (table) {
    table.increments(‘id_sst1’);
    table.string(‘test_sst1’);
    table.timestamp(‘created’);
    table.integer(‘image_id’).unsigned();
    table.foreign(‘image_id’).references(‘id’).inTable(‘images’).onUpdate(‘CASCADE’).onDelete(‘CASCADE’);
    table.integer(‘sub_table_id’).unsigned();
    table.foreign(‘sub_table_id’).references(‘id_st’).inTable(‘user_sub_table’).onUpdate(‘CASCADE’).onDelete(‘CASCADE’);
    })
    .createTable(‘user_sub_table_s_sub_t2’, async function (table) {
    table.increments(‘id_sst2’);
    table.timestamp(‘created’);
    table.string(‘string_sst2’);
    table.integer(‘creator_id’).unsigned();
    table.foreign(‘creator_id’).references(‘id’).inTable(‘users’).onUpdate(‘CASCADE’).onDelete(‘CASCADE’);
    table.integer(‘sub_table_id’).unsigned();
    table.foreign(‘sub_table_id’).references(‘id_st’).inTable(‘user_sub_table’).onUpdate(‘CASCADE’).onDelete(‘CASCADE’);
    })

    };

    exports.down = function(knex) {
    return knex.schema
    .dropTable(‘user_sub_table_s_sub_t2’)
    .dropTable(‘user_sub_table_s_sub_t1’)
    .dropTable(‘user_sub_table’)
    };

Thanks for the feedback

What is wrong with the test project?

This looks like it was applied correctly?

users is a main table

sub_table is a subtable

the other two are seen as multi reference as you created more relations than just the parent table (image and creator id)

Maybe I am misunderstanding?

1 Like

HI @Sorry_Duh,
Thanks for your answer.

For you the fourth step screencast is allright?

From what I understand the table s_sub_t2 is one level too high.
Some fields are missing.
Sub icons became multirelationnal.

Maybe it’s me who misunderstand the database manager tool and everything is fine.
If team could confirm?

Thanks

The missing fields should show in advanced mode they aren’t all available in basic

This table actually I think should be the same level as s_sub_t1, this one maybe a bug as it is going for the first available nesting level (which is the users table as you have a relation to users) rather than the one you specified (sub_table) would need the team to confirm this.

From my understanding main tables can have relations and remain main tables, but then when you start doing sub tables with multi relations to other tables it is detected as multi relation not sure about the first sub table as it has two relations but both to the same table (users) again the team would need to confirm if this is intended but I believe it has always done this