Collections cascading and copy

Hi All,

This is a series of tutorial about relational collections that are cascaded, meaning it is maintained in 1-to-many relationship.

There are 5 levels of collection, from top to bottom:

  1. highest such as projects
  2. higher such as activities inside project
  3. middle such as purchase orders inside activity
  4. lower such as order items inside purchase order
  5. lowest such as accessories inside order item

But, we will begin with lower first and later,
we will use lowest,
then going to middle, higher and highest

After that, we will copy all collections with its relations to other collections, so we have 2 copies, original and copy.

So for first step, we focus on lower level.

Relationship diagram as follows:

lower is connected to price of lower with 1-to-m relationship
lower is also connected to users, 1-to-m too

To make connection (add relationship property), I usually begin with transactional (lower level) collection and choose first option in the dialog box, “… can have multiple… / … belongs to …”

I rarely choose 2nd option, this is how I wire my brain to make it consistent. So, pick lower level collection first and choose option 1.

Cloneable app will soon follow.

UI and UX are very basic, because the goal is to learn how to do relational collections, few tricks will be introduced to make user do what they should do.

So rather than replying questions regarding database setup, I hope this tutorial can be used as an example to answer that.

2 Likes

App setting looked like this.

we need counter of id, because Adalo hide its id, much much later in tutorial, we will use it to construct relationship in copied collections.

3 Likes