How to maintain record relationships between Postgres and Airtable
customers
and reservations
. In this case, each customer can make many reservations over time, but each reservation only belongs to one customer. This is a one-to-many relationship. In Postgres, both tables would have primary key fields, but reservations
would also have a foreign key column that holds values from the customers
primary key.
In this case, we call records from customers
the “parent record,” and records from reservations
the “children records.”
unique
constraint enforced in Postgres.=RECORD_ID()
customers
and reservations
example, here’s a step-by-step guide:
customers
, and make sure that field syncs to Postgres.customers
table.customers
table.reservations
table, add a foreign key constraint on the linked record field in Airtable that references customers
.reservations
table.