# booking_booking_relationships

<!-- Generated from apps/irrigation/dbt_redshift/models/client_data/sources.yml. Do not edit by hand — run `make generate-client-data-dictionary`. -->

Links an original booking to a related booking, one row per link, discarded links included. For a tenancy takeover (reason tenancy_takeover) the related booking is the replacement tenant's booking; filter discarded_at IS NULL for the live replacement. Scoped to client workspaces.

| Column | Description |
| --- | --- |
| `id` | Unique identifier for the relationship |
| `workspace_id` | Identifier of the workspace the bookings belong to; matches workspaces.id |
| `source_booking_id` | Identifier of the original booking; matches bookings.id |
| `related_booking_id` | Identifier of the related booking, e.g. the tenancy takeover replacement; matches bookings.id |
| `relationship_type` | Kind of link; always relates_to today |
| `reason` | Why the bookings are linked: tenancy_takeover or rebooking |
| `discarded_at` | Timestamp when the related booking fell through and the link was discarded (NULL = live link) |
| `created_at` | Timestamp when the link was created |
| `updated_at` | Timestamp when the link was last updated; discarding it updates this |
| `timestamp` | Timestamp of the latest dlt load for this table |
