0
votes

App maker has relations to configure Primary and foreign key relation ship. I configure 1 to many relation, it creates parent column name in the child model.

I don't know how it works, it is taking the first column by default to save in the child model. I re ordered the fields but it is not changing the name and I have deleted the relation and re created but it is not reflecting.

Can any one explain how it works, Which field is configured as default primary key in the documentation also it is not mentioned any where.

1

1 Answers

0
votes

You can change relation names on both sides of the relation at any time without re-creating it: Relation insight

Drive Tables

For drive tables App Maker internally maintains _key, that is primary/foreign key SQL analogue. How the relation is handled under the hood is not exposed.

Cloud SQL

For cloud SQL things are little bit more transparent. For new models App Maker will automatically add id field that is primary key for SQL table and when you create a relation App Maker will automatically add foreign key column to the Model from the 'many' side.