diff --git a/database/README.md b/database/README.md index 7340a190..5e56744c 100644 --- a/database/README.md +++ b/database/README.md @@ -94,4 +94,9 @@ Each production release depends on the execution of a fixed set of scripts again - `ddl/STR_DSS_Incremental_DB_DDL_Sprint_13.sql` - `ddl/STR_DSS_Views_Sprint_13.sql` - `ddl/STR_DSS_Routines_Sprint_13.sql` - - `utility/Correct_Rental_Listings_Sprint_13.sql` \ No newline at end of file + - `utility/Correct_Rental_Listings_Sprint_13.sql` +- Sprint 14: + - `ddl/STR_DSS_Incremental_DB_DDL_Sprint_14.sql` + - `ddl/STR_DSS_Views_Sprint_14.sql` + - `seeding/STR_DSS_Data_Seeding_Sprint_14.sql` + - `utility/Correct_Rental_Listings_Sprint_14.sql` \ No newline at end of file diff --git a/database/model/PhysicalDataDiagram(Sprint14).svg b/database/model/PhysicalDataDiagram(Sprint14).svg new file mode 100644 index 00000000..7271a1be --- /dev/null +++ b/database/model/PhysicalDataDiagram(Sprint14).svg @@ -0,0 +1,1708 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + U + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Physical Data Diagram (Sprint 14) + Comments as mouse-over tips, zoom and pan.Read column and table comments by hovering the columns and tables. +Zoom with CTRL+whell mouse button, pan by dragging the diagram with the right-mouse button + by DbSchema.com - Wise CodersDbSchema is an universal database designer. +DbSchema has a free Community Edition. + + + + + + 🔗 Foreign Key dss_business_licence_fk_provided_by +dss_business_licence ref dss_organization ( providing_organization_id -> organization_id ) + +🔗 Foreign Key dss_business_licence_fk_provided_by +dss_business_licence ref dss_organization ( providing_organization_id -> organization_id ) +dss_business_licence_fk_provided_by + + + 🔗 Foreign Key dss_business_licence_fk_affecting +dss_business_licence ref dss_physical_address ( affected_by_physical_address_id -> physical_address_id ) + +🔗 Foreign Key dss_business_licence_fk_affecting +dss_business_licence ref dss_physical_address ( affected_by_physical_address_id -> physical_address_id ) +dss_business_licence_fk_affecting + + + 🔗 Foreign Key dss_business_licence_fk_classified_as +dss_business_licence ref dss_business_licence_status_type ( licence_status_type ) + +🔗 Foreign Key dss_business_licence_fk_classified_as +dss_business_licence ref dss_business_licence_status_type ( licence_status_type ) +dss_business_licence_fk_classified_as + + + 🔗 Foreign Key dss_email_message_fk_initiated_by +dss_email_message ref dss_user_identity ( initiating_user_identity_id -> user_identity_id ) + +🔗 Foreign Key dss_email_message_fk_initiated_by +dss_email_message ref dss_user_identity ( initiating_user_identity_id -> user_identity_id ) +dss_email_message_fk_initiated_by + + + 🔗 Foreign Key dss_email_message_fk_affecting +dss_email_message ref dss_user_identity ( affected_by_user_identity_id -> user_identity_id ) + +🔗 Foreign Key dss_email_message_fk_affecting +dss_email_message ref dss_user_identity ( affected_by_user_identity_id -> user_identity_id ) +dss_email_message_fk_affecting + + + 🔗 Foreign Key dss_email_message_fk_involving +dss_email_message ref dss_organization ( involved_in_organization_id -> organization_id ) + +🔗 Foreign Key dss_email_message_fk_involving +dss_email_message ref dss_organization ( involved_in_organization_id -> organization_id ) +dss_email_message_fk_involving + + + 🔗 Foreign Key dss_email_message_fk_communicating +dss_email_message ref dss_email_message_type ( email_message_type ) + +🔗 Foreign Key dss_email_message_fk_communicating +dss_email_message ref dss_email_message_type ( email_message_type ) +dss_email_message_fk_communicating + + + 🔗 Foreign Key dss_email_message_fk_batched_in +dss_email_message ref dss_email_message ( batching_email_message_id -> email_message_id ) + +🔗 Foreign Key dss_email_message_fk_batched_in +dss_email_message ref dss_email_message ( batching_email_message_id -> email_message_id ) +dss_email_message_fk_batched_in + + + 🔗 Foreign Key dss_email_message_fk_requested_by +dss_email_message ref dss_organization ( requesting_organization_id -> organization_id ) + +🔗 Foreign Key dss_email_message_fk_requested_by +dss_email_message ref dss_organization ( requesting_organization_id -> organization_id ) +dss_email_message_fk_requested_by + + + 🔗 Foreign Key dss_email_message_fk_included_in +dss_email_message ref dss_rental_listing ( concerned_with_rental_listing_id -> rental_listing_id ) + +🔗 Foreign Key dss_email_message_fk_included_in +dss_email_message ref dss_rental_listing ( concerned_with_rental_listing_id -> rental_listing_id ) +dss_email_message_fk_included_in + + + 🔗 Foreign Key dss_organization_fk_managed_by +dss_organization ref dss_organization ( managing_organization_id -> organization_id ) + +🔗 Foreign Key dss_organization_fk_managed_by +dss_organization ref dss_organization ( managing_organization_id -> organization_id ) +dss_organization_fk_managed_by + + + 🔗 Foreign Key dss_organization_fk_treated_as +dss_organization ref dss_organization_type ( organization_type ) + +🔗 Foreign Key dss_organization_fk_treated_as +dss_organization ref dss_organization_type ( organization_type ) +dss_organization_fk_treated_as + + + 🔗 Foreign Key dss_organization_contact_person_fk_contacted_for +dss_organization_contact_person ref dss_organization ( contacted_through_organization_id -> organization_id ) + +🔗 Foreign Key dss_organization_contact_person_fk_contacted_for +dss_organization_contact_person ref dss_organization ( contacted_through_organization_id -> organization_id ) +dss_organization_contact_person_fk_contacted_for + + + 🔗 Foreign Key dss_organization_contact_person_fk_subscribed_to +dss_organization_contact_person ref dss_email_message_type ( email_message_type ) + +🔗 Foreign Key dss_organization_contact_person_fk_subscribed_to +dss_organization_contact_person ref dss_email_message_type ( email_message_type ) +dss_organization_contact_person_fk_subscribed_to + + + 🔗 Foreign Key dss_physical_address_fk_contained_in +dss_physical_address ref dss_organization ( containing_organization_id -> organization_id ) + +🔗 Foreign Key dss_physical_address_fk_contained_in +dss_physical_address ref dss_organization ( containing_organization_id -> organization_id ) +dss_physical_address_fk_contained_in + + + 🔗 Foreign Key dss_physical_address_fk_replaced_by +dss_physical_address ref dss_physical_address ( replacing_physical_address_id -> physical_address_id ) + +🔗 Foreign Key dss_physical_address_fk_replaced_by +dss_physical_address ref dss_physical_address ( replacing_physical_address_id -> physical_address_id ) +dss_physical_address_fk_replaced_by + + + 🔗 Foreign Key dss_rental_listing_fk_offered_by +dss_rental_listing ref dss_organization ( offering_organization_id -> organization_id ) + +🔗 Foreign Key dss_rental_listing_fk_offered_by +dss_rental_listing ref dss_organization ( offering_organization_id -> organization_id ) +dss_rental_listing_fk_offered_by + + + 🔗 Foreign Key dss_rental_listing_fk_included_in +dss_rental_listing ref dss_rental_listing_report ( including_rental_listing_report_id -> rental_listing_report_id ) + +🔗 Foreign Key dss_rental_listing_fk_included_in +dss_rental_listing ref dss_rental_listing_report ( including_rental_listing_report_id -> rental_listing_report_id ) +dss_rental_listing_fk_included_in + + + 🔗 Foreign Key dss_rental_listing_fk_located_at +dss_rental_listing ref dss_physical_address ( locating_physical_address_id -> physical_address_id ) + +🔗 Foreign Key dss_rental_listing_fk_located_at +dss_rental_listing ref dss_physical_address ( locating_physical_address_id -> physical_address_id ) +dss_rental_listing_fk_located_at + + + 🔗 Foreign Key dss_rental_listing_fk_generating +dss_rental_listing ref dss_rental_listing ( derived_from_rental_listing_id -> rental_listing_id ) + +🔗 Foreign Key dss_rental_listing_fk_generating +dss_rental_listing ref dss_rental_listing ( derived_from_rental_listing_id -> rental_listing_id ) +dss_rental_listing_fk_generating + + + 🔗 Foreign Key dss_rental_listing_fk_classified_as +dss_rental_listing ref dss_listing_status_type ( listing_status_type ) + +🔗 Foreign Key dss_rental_listing_fk_classified_as +dss_rental_listing ref dss_listing_status_type ( listing_status_type ) +dss_rental_listing_fk_classified_as + + + 🔗 Foreign Key dss_rental_listing_fk_governed_by +dss_rental_listing ref dss_business_licence ( governing_business_licence_id -> business_licence_id ) + +🔗 Foreign Key dss_rental_listing_fk_governed_by +dss_rental_listing ref dss_business_licence ( governing_business_licence_id -> business_licence_id ) +dss_rental_listing_fk_governed_by + + + 🔗 Foreign Key dss_rental_listing_contact_fk_contacted_for +dss_rental_listing_contact ref dss_rental_listing ( contacted_through_rental_listing_id -> rental_listing_id ) + +🔗 Foreign Key dss_rental_listing_contact_fk_contacted_for +dss_rental_listing_contact ref dss_rental_listing ( contacted_through_rental_listing_id -> rental_listing_id ) +dss_rental_listing_contact_fk_contacted_for + + + 🔗 Foreign Key dss_rental_listing_extract_fk_filtered_by +dss_rental_listing_extract ref dss_organization ( filtering_organization_id -> organization_id ) + +🔗 Foreign Key dss_rental_listing_extract_fk_filtered_by +dss_rental_listing_extract ref dss_organization ( filtering_organization_id -> organization_id ) +dss_rental_listing_extract_fk_filtered_by + + + 🔗 Foreign Key dss_rental_listing_report_fk_provided_by +dss_rental_listing_report ref dss_organization ( providing_organization_id -> organization_id ) + +🔗 Foreign Key dss_rental_listing_report_fk_provided_by +dss_rental_listing_report ref dss_organization ( providing_organization_id -> organization_id ) +dss_rental_listing_report_fk_provided_by + + + 🔗 Foreign Key dss_upload_delivery_fk_provided_by +dss_upload_delivery ref dss_organization ( providing_organization_id -> organization_id ) + +🔗 Foreign Key dss_upload_delivery_fk_provided_by +dss_upload_delivery ref dss_organization ( providing_organization_id -> organization_id ) +dss_upload_delivery_fk_provided_by + + + 🔗 Foreign Key dss_upload_line_fk_included_in +dss_upload_line ref dss_upload_delivery ( including_upload_delivery_id -> upload_delivery_id ) + +🔗 Foreign Key dss_upload_line_fk_included_in +dss_upload_line ref dss_upload_delivery ( including_upload_delivery_id -> upload_delivery_id ) +dss_upload_line_fk_included_in + + + 🔗 Foreign Key dss_user_identity_fk_representing +dss_user_identity ref dss_organization ( represented_by_organization_id -> organization_id ) + +🔗 Foreign Key dss_user_identity_fk_representing +dss_user_identity ref dss_organization ( represented_by_organization_id -> organization_id ) +dss_user_identity_fk_representing + + + 🔗 Foreign Key dss_user_identity_fk_given +dss_user_identity ref dss_access_request_status ( access_request_status_cd ) + +🔗 Foreign Key dss_user_identity_fk_given +dss_user_identity ref dss_access_request_status ( access_request_status_cd ) +dss_user_identity_fk_given + + + 🔗 Foreign Key dss_user_role_assignment_fk_granted +dss_user_role_assignment ref dss_user_role ( user_role_cd ) + +🔗 Foreign Key dss_user_role_assignment_fk_granted +dss_user_role_assignment ref dss_user_role ( user_role_cd ) +dss_user_role_assignment_fk_granted + + + 🔗 Foreign Key dss_user_role_assignment_fk_granted_to +dss_user_role_assignment ref dss_user_identity ( user_identity_id ) + +🔗 Foreign Key dss_user_role_assignment_fk_granted_to +dss_user_role_assignment ref dss_user_identity ( user_identity_id ) +dss_user_role_assignment_fk_granted_to + + + 🔗 Foreign Key dss_user_role_privilege_fk_conferred_by +dss_user_role_privilege ref dss_user_role ( user_role_cd ) + +🔗 Foreign Key dss_user_role_privilege_fk_conferred_by +dss_user_role_privilege ref dss_user_role ( user_role_cd ) +dss_user_role_privilege_fk_conferred_by + + + 🔗 Foreign Key dss_user_role_privilege_fk_conferring +dss_user_role_privilege ref dss_user_privilege ( user_privilege_cd ) + +🔗 Foreign Key dss_user_role_privilege_fk_conferring +dss_user_role_privilege ref dss_user_privilege ( user_privilege_cd ) +dss_user_role_privilege_fk_conferring + + + + +dss_access_request_statusTable dss.dss_access_request_status + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + A potential status for a user access request (e.g. Requested, Approved, or Denied) + 🔑 Pk dss_access_request_status_pk ( access_request_status_cd ) access_request_status_cd⧉ access_request_status_cd + * varchar(25) + ↙ dss_user_identity( access_request_status_cd ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + System-consistent code for the request status +varchar(25)🔗 Referred by dss_user_identity ( access_request_status_cd ) + access_request_status_nm⧉ access_request_status_nm + * varchar(250) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Business term for the request status +varchar(250) + + + + +dss_business_licenceTable dss.dss_business_licence + 🔑 Pk dss_business_licence_pk ( business_licence_id ) business_licence_id⧉ business_licence_id + * bigint + ↙ dss_rental_listing( business_licence_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Unique generated key +bigint🔗 Referred by dss_rental_listing ( governing_business_licence_id -> business_licence_id ) + 🔍 Unq dss_business_licence_uk ( providing_organization_id, business_licence_no ) business_licence_no⧉ business_licence_no + * varchar(50) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The local government issued licence number that applies to the rental offering +varchar(50) expiry_dt⧉ expiry_dt + * date + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The date on which the business licence expires +date 🔍 dss_business_licence_i3 ( physical_rental_address_txt ) physical_rental_address_txt⧉ physical_rental_address_txt + varchar(250) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The full physical address of the location that is licenced as a short-term rental business +varchar(250) licence_type_txt⧉ licence_type_txt + varchar(320) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Free form description of the type of business licence issued (e.g. short-term rental, bed and breakfast, boarding and lodging, tourist accommodation) +varchar(320) restriction_txt⧉ restriction_txt + varchar(320) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Notes related to any restrictions associated with the licence +varchar(320) business_nm⧉ business_nm + varchar(320) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Official name of the business +varchar(320) mailing_street_address_txt⧉ mailing_street_address_txt + varchar(100) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Street address component of the business mailing address +varchar(100) mailing_city_nm⧉ mailing_city_nm + varchar(100) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + City component of the business mailing address +varchar(100) mailing_province_cd⧉ mailing_province_cd + varchar(2) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Province component of the business mailing address +varchar(2) mailing_postal_cd⧉ mailing_postal_cd + varchar(10) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Postal code component of the business mailing address +varchar(10) business_owner_nm⧉ business_owner_nm + varchar(320) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Full name of the registered business owner +varchar(320) business_owner_phone_no⧉ business_owner_phone_no + varchar(30) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Phone number of the business owner +varchar(30) business_owner_email_address_dsc⧉ business_owner_email_address_dsc + varchar(320) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Email address of the business owner +varchar(320) business_operator_nm⧉ business_operator_nm + varchar(320) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Full name of the business operator or property manager +varchar(320) business_operator_phone_no⧉ business_operator_phone_no + varchar(30) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Phone number of the business operator +varchar(30) business_operator_email_address_dsc⧉ business_operator_email_address_dsc + varchar(320) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Email address of the business operator +varchar(320) infraction_txt⧉ infraction_txt + varchar(320) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Description of an infraction +varchar(320) infraction_dt⧉ infraction_dt + date + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The date on which the described infraction occurred +date property_zone_txt⧉ property_zone_txt + varchar(100) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Description or name of the property zoning +varchar(100) available_bedrooms_qty⧉ available_bedrooms_qty + smallint + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The number of bedrooms in the dwelling unit that are available for short term rental +smallint max_guests_allowed_qty⧉ max_guests_allowed_qty + smallint + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The number of guests that can be accommodated +smallint is_principal_residence⧉ is_principal_residence + boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates whether the short term rental property is a principal residence +boolean is_owner_living_onsite⧉ is_owner_living_onsite + boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates whether the owner lives on the property +boolean is_owner_property_tenant⧉ is_owner_property_tenant + boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates whether the business owner rents the property +boolean property_folio_no⧉ property_folio_no + varchar(30) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The number used to identify the property +varchar(30) property_parcel_identifier_no⧉ property_parcel_identifier_no + varchar(30) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The PID number assigned by the Land Title and Survey Authority that identifies the piece of land +varchar(30) property_legal_description_txt⧉ property_legal_description_txt + varchar(320) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The physical description of the property as it is registered with the Land Title and Survey Authority +varchar(320) 🔍 dss_business_licence_i1 ( licence_status_type ) licence_status_type⧉ licence_status_type + * varchar(25) + ↗ dss_business_licence( licence_status_type ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Foreign key +varchar(25)🔗 References dss_business_licence_status_type ( licence_status_type ) + 🔍 Unq dss_business_licence_uk ( providing_organization_id, business_licence_no ) providing_organization_id⧉ providing_organization_id + * bigint + ↗ dss_business_licence( organization_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Foreign key +bigint🔗 References dss_organization ( providing_organization_id -> organization_id ) + 🔍 dss_business_licence_i2 ( affected_by_physical_address_id ) affected_by_physical_address_id⧉ affected_by_physical_address_id + bigint + ↗ dss_business_licence( physical_address_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Foreign key +bigint🔗 References dss_physical_address ( affected_by_physical_address_id -> physical_address_id ) + upd_dtm⧉ upd_dtm + * timestamptz + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Trigger-updated timestamp of last change +timestamptz upd_user_guid⧉ upd_user_guid + uuid + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The globally unique identifier (assigned by the identity provider) for the most recent user to record a change +uuid + + + + +dss_business_licence_status_typeTable dss.dss_business_licence_status_type + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + A potential status for a BUSINESS LICENCE (e.g. Pending, Issued, Suspended, Revoked, Cancelled, Expired) + 🔑 Pk dss_business_licence_status_type_pk ( licence_status_type ) licence_status_type⧉ licence_status_type + * varchar(25) + ↙ dss_business_licence( licence_status_type ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + System-consistent code for the business licence status (e.g. Pending, Issued, Suspended, Revoked, Cancelled, Expired) +varchar(25)🔗 Referred by dss_business_licence ( licence_status_type ) + licence_status_type_nm⧉ licence_status_type_nm + * varchar(50) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Business term for the licence status (e.g. Pending, Issued, Suspended, Revoked, Cancelled, Expired) +varchar(50) licence_status_sort_no⧉ licence_status_sort_no + * smallint + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Relative order in which the business prefers to see the status listed +smallint + + + + +dss_email_messageTable dss.dss_email_message + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + A message that is sent to one or more recipients via email + 🔑 Pk dss_email_message_pk ( email_message_id ) email_message_id⧉ email_message_id + * bigint + ↙ dss_email_message( email_message_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Unique generated key +bigint🔗 Referred by dss_email_message ( batching_email_message_id -> email_message_id ) + email_message_type⧉ email_message_type + * varchar(50) + ↗ dss_email_message( email_message_type ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Foreign key +varchar(50)🔗 References dss_email_message_type ( email_message_type ) + 🔍 dss_email_message_i1 ( concerned_with_rental_listing_id, message_delivery_dtm ) message_delivery_dtm⧉ message_delivery_dtm + * timestamptz + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + A timestamp indicating when the message delivery was initiated +timestamptz message_template_dsc⧉ message_template_dsc + * varchar(4000) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The full text or template for the message that is sent +varchar(4000) is_submitter_cc_required⧉ is_submitter_cc_required + * boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates whether the user initiating the message should receive a copy of the email +boolean is_host_contacted_externally⧉ is_host_contacted_externally + boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates whether the the property host has already been contacted by external means +boolean is_with_standard_detail⧉ is_with_standard_detail + boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates whether message body should include text a block of detail text that is standard for the message type +boolean lg_phone_no⧉ lg_phone_no + varchar(30) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + A phone number associated with a Local Government contact +varchar(30) unreported_listing_no⧉ unreported_listing_no + varchar(50) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The platform issued identification number for the listing (if not included in a rental listing report) +varchar(50) host_email_address_dsc⧉ host_email_address_dsc + varchar(320) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + E-mail address of a short term rental host (directly entered by the user as a message recipient) +varchar(320) lg_email_address_dsc⧉ lg_email_address_dsc + varchar(320) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + E-mail address of a local government contact (directly entered by the user as a message recipient) +varchar(320) cc_email_address_dsc⧉ cc_email_address_dsc + varchar(4000) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + E-mail address of a secondary message recipient (directly entered by the user) +varchar(4000) unreported_listing_url⧉ unreported_listing_url + varchar(4000) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + User-provided URL for a short-term rental platform listing that is the subject of the message +varchar(4000) lg_str_bylaw_url⧉ lg_str_bylaw_url + varchar(4000) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + User-provided URL for a local government bylaw that is the subject of the message +varchar(4000) custom_detail_txt⧉ custom_detail_txt + varchar(4000) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Free form text that should be included in the message body +varchar(4000) 🔍 dss_email_message_i1 ( concerned_with_rental_listing_id, message_delivery_dtm ) concerned_with_rental_listing_id⧉ concerned_with_rental_listing_id + bigint + ↗ dss_email_message( rental_listing_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Foreign key +bigint🔗 References dss_rental_listing ( concerned_with_rental_listing_id -> rental_listing_id ) + initiating_user_identity_id⧉ initiating_user_identity_id + bigint + ↗ dss_email_message( user_identity_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Foreign key +bigint🔗 References dss_user_identity ( initiating_user_identity_id -> user_identity_id ) + affected_by_user_identity_id⧉ affected_by_user_identity_id + bigint + ↗ dss_email_message( user_identity_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Foreign key +bigint🔗 References dss_user_identity ( affected_by_user_identity_id -> user_identity_id ) + involved_in_organization_id⧉ involved_in_organization_id + bigint + ↗ dss_email_message( organization_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Foreign key +bigint🔗 References dss_organization ( involved_in_organization_id -> organization_id ) + batching_email_message_id⧉ batching_email_message_id + bigint + ↗ dss_email_message( email_message_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Foreign key +bigint🔗 References dss_email_message ( batching_email_message_id -> email_message_id ) + requesting_organization_id⧉ requesting_organization_id + bigint + ↗ dss_email_message( organization_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Foreign key +bigint🔗 References dss_organization ( requesting_organization_id -> organization_id ) + external_message_no⧉ external_message_no + varchar(50) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + External identifier for tracking the message delivery progress +varchar(50) upd_dtm⧉ upd_dtm + timestamptz + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Trigger-updated timestamp of last change +timestamptz upd_user_guid⧉ upd_user_guid + uuid + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The globally unique identifier (assigned by the identity provider) for the most recent user to record a change +uuid + + + + +dss_email_message_typeTable dss.dss_email_message_type + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The type or purpose of a system generated message (e.g. Notice of Takedown, Takedown Request, Delisting Warning, Delisting Request, Access Granted Notification, Access Denied Notification) + 🔑 Pk dss_email_message_type_pk ( email_message_type ) email_message_type⧉ email_message_type + * varchar(50) + ↙ dss_email_message( email_message_type ) + ↙ dss_organization_contact_person( email_message_type ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + System-consistent code for the type or purpose of the message (e.g. Notice of Takedown, Takedown Request, Delisting Warning, Delisting Request, Access Granted Notification, Access Denied Notification) +varchar(50)🔗 Referred by dss_email_message ( email_message_type ) +Referred by dss_organization_contact_person ( email_message_type ) + email_message_type_nm⧉ email_message_type_nm + * varchar(250) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Business term for the type or purpose of the message (e.g. Notice of Takedown, Takedown Request, Delisting Warning, Delisting Request, Access Granted Notification, Access Denied Notification) +varchar(250) + + + + +dss_listing_status_typeTable dss.dss_listing_status_type + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + A potential status for a CURRENT RENTAL LISTING (e.g. New, Active, Inactive, Reassigned, Taken Down) + 🔑 Pk dss_listing_status_type_pk ( listing_status_type ) listing_status_type⧉ listing_status_type + * varchar(2) + ↙ dss_rental_listing( listing_status_type ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + System-consistent code for the listing status (e.g. N, A, I, R, T) +varchar(2)🔗 Referred by dss_rental_listing ( listing_status_type ) + listing_status_type_nm⧉ listing_status_type_nm + * varchar(50) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Business term for the listing status (e.g. New, Active, Inactive, Reassigned, Taken Down) +varchar(50) listing_status_sort_no⧉ listing_status_sort_no + * smallint + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Relative order in which the business prefers to see the status listed +smallint + + + + +dss_organizationTable dss.dss_organization + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + A private company or governing body component that plays a role in short term rental reporting or enforcement + 🔑 Pk dss_organization_pk ( organization_id ) organization_id⧉ organization_id + * bigint + ↙ dss_business_licence( organization_id ) + ↙ dss_email_message( organization_id ) + ↙ dss_email_message( organization_id ) + ↙ dss_organization( organization_id ) + ↙ dss_organization_contact_person( organization_id ) + ↙ dss_physical_address( organization_id ) + ↙ dss_rental_listing( organization_id ) + ↙ dss_rental_listing_extract( organization_id ) + ↙ dss_rental_listing_report( organization_id ) + ↙ dss_upload_delivery( organization_id ) + ↙ dss_user_identity( organization_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Unique generated key +bigint🔗 Referred by dss_business_licence ( providing_organization_id -> organization_id ) +Referred by dss_email_message ( involved_in_organization_id -> organization_id ) +Referred by dss_email_message ( requesting_organization_id -> organization_id ) +Referred by dss_organization ( managing_organization_id -> organization_id ) +Referred by dss_organization_contact_person ( contacted_through_organization_id -> organization_id ) +Referred by dss_physical_address ( containing_organization_id -> organization_id ) +Referred by dss_rental_listing ( offering_organization_id -> organization_id ) +Referred by dss_rental_listing_extract ( filtering_organization_id -> organization_id ) +Referred by dss_rental_listing_report ( providing_organization_id -> organization_id ) +Referred by dss_upload_delivery ( providing_organization_id -> organization_id ) +Referred by dss_user_identity ( represented_by_organization_id -> organization_id ) + 🔍 dss_organization_i1 ( organization_type ) organization_type⧉ organization_type + * varchar(25) + ↗ dss_organization( organization_type ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Foreign key +varchar(25)🔗 References dss_organization_type ( organization_type ) + 🔍 Unq dss_organization_uk ( organization_cd ) organization_cd⧉ organization_cd + * varchar(25) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + An immutable system code that identifies the organization (e.g. CEU, AIRBNB) +varchar(25) organization_nm⧉ organization_nm + * varchar(250) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + A human-readable name that identifies the organization (e.g. Corporate Enforecement Unit, City of Victoria) +varchar(250) local_government_type⧉ local_government_type + varchar(50) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + A sub-type of local government organization used for sorting and grouping or members +varchar(50) economic_region_dsc⧉ economic_region_dsc + varchar(100) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + A free form description of the economic region to which a Local Government Subdivision belongs +varchar(100) is_lg_participating⧉ is_lg_participating + boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates whether a LOCAL GOVERNMENT ORGANIZATION participates in Short Term Rental Data Sharing +boolean is_str_prohibited⧉ is_str_prohibited + boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates whether a LOCAL GOVERNMENT ORGANIZATION entirely prohibits short term housing rentals +boolean is_principal_residence_required⧉ is_principal_residence_required + boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates whether a LOCAL GOVERNMENT SUBDIVISION is subject to Provincial Principal Residence Short Term Rental restrictions +boolean is_business_licence_required⧉ is_business_licence_required + boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates whether a LOCAL GOVERNMENT SUBDIVISION requires a business licence for Short Term Rental operation +boolean area_geometry⧉ area_geometry + geometry + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + the multipolygon shape identifying the boundaries of a local government subdivision +geometry 🔍 dss_organization_i2 ( managing_organization_id ) managing_organization_id⧉ managing_organization_id + bigint + ↗ dss_organization( organization_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Self-referential hierarchical foreign key +bigint🔗 References dss_organization ( managing_organization_id -> organization_id ) + upd_dtm⧉ upd_dtm + * timestamptz + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Trigger-updated timestamp of last change +timestamptz upd_user_guid⧉ upd_user_guid + uuid + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The globally unique identifier (assigned by the identity provider) for the most recent user to record a change +uuid + + + + +dss_organization_contact_personTable dss.dss_organization_contact_person + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + A person who has been identified as a notable contact for a particular organization + 🔑 Pk dss_organization_contact_person_pk ( organization_contact_person_id ) organization_contact_person_id⧉ organization_contact_person_id + * bigint + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Unique generated key +bigint email_address_dsc⧉ email_address_dsc + * varchar(320) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + E-mail address given for the contact by the organization +varchar(320) is_primary⧉ is_primary + boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates whether the contact should receive all communications directed at the organization +boolean given_nm⧉ given_nm + varchar(25) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + A name given to a person so that they can easily be identified among their family members (in some cultures, this is often the first name) +varchar(25) family_nm⧉ family_nm + varchar(25) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + A name that is often shared amongst members of the same family (commonly known as a surname within some cultures) +varchar(25) phone_no⧉ phone_no + varchar(30) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Phone number given for the contact by the organization (contains only digits) +varchar(30) contacted_through_organization_id⧉ contacted_through_organization_id + * bigint + ↗ dss_organization_contact_person( organization_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Foreign key +bigint🔗 References dss_organization ( contacted_through_organization_id -> organization_id ) + email_message_type⧉ email_message_type + varchar(50) + ↗ dss_organization_contact_person( email_message_type ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Foreign key +varchar(50)🔗 References dss_email_message_type ( email_message_type ) + upd_dtm⧉ upd_dtm + * timestamptz + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Trigger-updated timestamp of last change +timestamptz upd_user_guid⧉ upd_user_guid + uuid + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The globally unique identifier (assigned by the identity provider) for the most recent user to record a change +uuid + + + + +dss_organization_typeTable dss.dss_organization_type + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + A level of government or business category + 🔑 Pk dss_organization_type_pk ( organization_type ) organization_type⧉ organization_type + * varchar(25) + ↙ dss_organization( organization_type ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + System-consistent code for a level of government or business category +varchar(25)🔗 Referred by dss_organization ( organization_type ) + organization_type_nm⧉ organization_type_nm + * varchar(250) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Business term for a level of government or business category +varchar(250) + + + + +dss_physical_addressTable dss.dss_physical_address + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + A property address that includes any verifiable BC attributes + 🔑 Pk dss_physical_address_pk ( physical_address_id ) physical_address_id⧉ physical_address_id + * bigint + ↙ dss_business_licence( physical_address_id ) + ↙ dss_physical_address( physical_address_id ) + ↙ dss_rental_listing( physical_address_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Unique generated key +bigint🔗 Referred by dss_business_licence ( affected_by_physical_address_id -> physical_address_id ) +Referred by dss_physical_address ( replacing_physical_address_id -> physical_address_id ) +Referred by dss_rental_listing ( locating_physical_address_id -> physical_address_id ) + 🔍 dss_physical_address_i1 ( original_address_txt ) original_address_txt⧉ original_address_txt + * varchar(250) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The source-provided address of a short-term rental offering +varchar(250) match_result_json⧉ match_result_json + json + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Full JSON result of the source address matching attempt +json 🔍 dss_physical_address_i2 ( match_address_txt ) match_address_txt⧉ match_address_txt + varchar(250) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The sanitized physical address (returned as fullAddress) that has been derived from the original +varchar(250) match_score_amt⧉ match_score_amt + smallint + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The relative score returned from the address matching attempt +smallint unit_no⧉ unit_no + varchar(50) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The unitNumber (suite) returned by the address match (e.g. 100) +varchar(50) civic_no⧉ civic_no + varchar(50) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The civicNumber (building number) returned by the address match (e.g. 1285) +varchar(50) street_nm⧉ street_nm + varchar(100) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The streetName returned by the address match (e.g. Pender) +varchar(100) street_type_dsc⧉ street_type_dsc + varchar(50) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The streetType returned by the address match (e.g. St or Street) +varchar(50) street_direction_dsc⧉ street_direction_dsc + varchar(50) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The streetDirection returned by the address match (e.g. W or West) +varchar(50) locality_nm⧉ locality_nm + varchar(100) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The localityName (community) returned by the address match (e.g. Vancouver) +varchar(100) locality_type_dsc⧉ locality_type_dsc + varchar(50) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The localityType returned by the address match (e.g. City) +varchar(50) province_cd⧉ province_cd + varchar(5) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The provinceCode returned by the address match +varchar(5) site_no⧉ site_no + varchar(50) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The siteID returned by the address match +varchar(50) block_no⧉ block_no + varchar(50) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The blockID returned by the address match +varchar(50) location_geometry⧉ location_geometry + geometry + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The computed location point of the matched address +geometry is_exempt⧉ is_exempt + boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates whether the address has been identified as exempt from Short Term Rental regulations +boolean is_match_verified⧉ is_match_verified + boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates whether the matched address has been verified as correct for the listing by the responsible authorities +boolean is_changed_original_address⧉ is_changed_original_address + boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates whether the original address has received a different property address from the platform in the last reporting period +boolean is_match_corrected⧉ is_match_corrected + boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates whether the matched address has been manually changed to one that is verified as correct for the listing +boolean is_system_processing⧉ is_system_processing + boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates whether the physical address is being processed by the system and may not yet be in its final form +boolean 🔍 dss_physical_address_i3 ( containing_organization_id ) containing_organization_id⧉ containing_organization_id + bigint + ↗ dss_physical_address( organization_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Foreign key +bigint🔗 References dss_organization ( containing_organization_id -> organization_id ) + replacing_physical_address_id⧉ replacing_physical_address_id + bigint + ↗ dss_physical_address( physical_address_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Foreign key +bigint🔗 References dss_physical_address ( replacing_physical_address_id -> physical_address_id ) + upd_dtm⧉ upd_dtm + * timestamptz + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Trigger-updated timestamp of last change +timestamptz upd_user_guid⧉ upd_user_guid + uuid + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The globally unique identifier (assigned by the identity provider) for the most recent user to record a change +uuid + + + + +dss_rental_listingTable dss.dss_rental_listing + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + A rental listing snapshot that is either relevant to a specific monthly report, or is the current, master version + 🔑 Pk dss_rental_listing_pk ( rental_listing_id ) rental_listing_id⧉ rental_listing_id + * bigint + ↙ dss_email_message( rental_listing_id ) + ↙ dss_rental_listing( rental_listing_id ) + ↙ dss_rental_listing_contact( rental_listing_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Unique generated key +bigint🔗 Referred by dss_email_message ( concerned_with_rental_listing_id -> rental_listing_id ) +Referred by dss_rental_listing ( derived_from_rental_listing_id -> rental_listing_id ) +Referred by dss_rental_listing_contact ( contacted_through_rental_listing_id -> rental_listing_id ) + 🔍 dss_rental_listing_i1 ( offering_organization_id, platform_listing_no ) platform_listing_no⧉ platform_listing_no + * varchar(50) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The platform issued identification number for the listing +varchar(50) platform_listing_url⧉ platform_listing_url + varchar(4000) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + URL for the short-term rental platform listing +varchar(4000) 🔍 dss_rental_listing_i7 ( business_licence_no ) business_licence_no⧉ business_licence_no + varchar(320) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The business licence number that is published for the rental offering +varchar(320) 🔍 dss_rental_listing_i8 ( effective_business_licence_no ) effective_business_licence_no⧉ effective_business_licence_no + varchar(320) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The local government issued licence number that should be used for compariing the rental offering with others +varchar(320) 🔍 dss_rental_listing_i9 ( effective_host_nm ) effective_host_nm⧉ effective_host_nm + varchar(320) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The full name of the rental offering host that should be used for comparison with others +varchar(320) bc_registry_no⧉ bc_registry_no + varchar(50) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The Short Term Registry issued permit number +varchar(50) is_current⧉ is_current + * boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates whether the RENTAL LISTING VERSION is a CURRENT RENTAL LISTING (if it is a copy of the most current REPORTED RENTAL LISTING (having the same listing number for the same offering platform) +boolean is_active⧉ is_active + boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates whether a CURRENT RENTAL LISTING was included in the most recent RENTAL LISTING REPORT +boolean is_new⧉ is_new + boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates whether a CURRENT RENTAL LISTING appeared for the first time in the last reporting period +boolean is_taken_down⧉ is_taken_down + boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates whether a CURRENT RENTAL LISTING has been reported as taken down by the offering platform +boolean is_changed_original_address⧉ is_changed_original_address + boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates whether a CURRENT RENTAL LISTING has received a different property address in the last reporting period +boolean is_changed_address⧉ is_changed_address + boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates whether a CURRENT RENTAL LISTING has been subjected to address match changes by a user +boolean is_lg_transferred⧉ is_lg_transferred + boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates whether a CURRENT RENTAL LISTING has been transferred to a different Local Goverment Organization as a result of address changes +boolean is_changed_business_licence⧉ is_changed_business_licence + boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates whether a CURRENT RENTAL LISTING has been subjected to business licence linking changes by a user +boolean is_entire_unit⧉ is_entire_unit + boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates whether the entire dwelling unit is offered for rental (as opposed to a single bedroom) +boolean 🔍 dss_rental_listing_i11 ( lg_transfer_dtm ) lg_transfer_dtm⧉ lg_transfer_dtm + timestamptz + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates when a CURRENT RENTAL LISTING was most recently transferred to a different Local Goverment Organization as a result of address changes +timestamptz available_bedrooms_qty⧉ available_bedrooms_qty + smallint + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The number of bedrooms in the dwelling unit that are available for short term rental +smallint nights_booked_qty⧉ nights_booked_qty + smallint + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The number of nights that short term rental accommodation services were provided during the reporting period +smallint separate_reservations_qty⧉ separate_reservations_qty + smallint + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The number of separate reservations that were taken during the reporting period +smallint 🔍 dss_rental_listing_i1 ( offering_organization_id, platform_listing_no ) 🔍 dss_rental_listing_i5 ( listing_status_type, offering_organization_id ) offering_organization_id⧉ offering_organization_id + * bigint + ↗ dss_rental_listing( organization_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Foreign key +bigint🔗 References dss_organization ( offering_organization_id -> organization_id ) + 🔍 dss_rental_listing_i2 ( including_rental_listing_report_id ) including_rental_listing_report_id⧉ including_rental_listing_report_id + bigint + ↗ dss_rental_listing( rental_listing_report_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Foreign key +bigint🔗 References dss_rental_listing_report ( including_rental_listing_report_id -> rental_listing_report_id ) + 🔍 dss_rental_listing_i3 ( derived_from_rental_listing_id ) derived_from_rental_listing_id⧉ derived_from_rental_listing_id + bigint + ↗ dss_rental_listing( rental_listing_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Foreign key +bigint🔗 References dss_rental_listing ( derived_from_rental_listing_id -> rental_listing_id ) + 🔍 dss_rental_listing_i4 ( locating_physical_address_id ) locating_physical_address_id⧉ locating_physical_address_id + bigint + ↗ dss_rental_listing( physical_address_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Foreign key +bigint🔗 References dss_physical_address ( locating_physical_address_id -> physical_address_id ) + 🔍 dss_rental_listing_i6 ( governing_business_licence_id ) governing_business_licence_id⧉ governing_business_licence_id + bigint + ↗ dss_rental_listing( business_licence_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Foreign key +bigint🔗 References dss_business_licence ( governing_business_licence_id -> business_licence_id ) + 🔍 dss_rental_listing_i5 ( listing_status_type, offering_organization_id ) listing_status_type⧉ listing_status_type + varchar(2) + ↗ dss_rental_listing( listing_status_type ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Foreign key +varchar(2)🔗 References dss_listing_status_type ( listing_status_type ) + upd_dtm⧉ upd_dtm + * timestamptz + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Trigger-updated timestamp of last change +timestamptz upd_user_guid⧉ upd_user_guid + uuid + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The globally unique identifier (assigned by the identity provider) for the most recent user to record a change +uuid + + + + +dss_rental_listing_contactTable dss.dss_rental_listing_contact + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + A person who has been identified as a notable contact for a particular rental listing + 🔑 Pk dss_rental_listing_contact_pk ( rental_listing_contact_id ) rental_listing_contact_id⧉ rental_listing_contact_id + * bigint + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Unique generated key +bigint is_property_owner⧉ is_property_owner + * boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates a person with the legal right to the unit being short-term rental +boolean listing_contact_nbr⧉ listing_contact_nbr + smallint + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates which of the five possible supplier hosts is represented by this contact +smallint supplier_host_no⧉ supplier_host_no + varchar(50) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The platform identifier for the supplier host +varchar(50) full_nm⧉ full_nm + varchar(320) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The full name of the contact person as included in the listing +varchar(320) phone_no⧉ phone_no + varchar(30) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Phone number given for the contact +varchar(30) fax_no⧉ fax_no + varchar(30) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Facsimile numbrer given for the contact +varchar(30) full_address_txt⧉ full_address_txt + varchar(250) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Mailing address given for the contact +varchar(250) email_address_dsc⧉ email_address_dsc + varchar(320) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + E-mail address given for the contact +varchar(320) 🔍 dss_rental_listing_contact_i1 ( contacted_through_rental_listing_id ) contacted_through_rental_listing_id⧉ contacted_through_rental_listing_id + * bigint + ↗ dss_rental_listing_contact( rental_listing_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Foreign key +bigint🔗 References dss_rental_listing ( contacted_through_rental_listing_id -> rental_listing_id ) + upd_dtm⧉ upd_dtm + * timestamptz + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Trigger-updated timestamp of last change +timestamptz upd_user_guid⧉ upd_user_guid + uuid + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The globally unique identifier (assigned by the identity provider) for the most recent user to record a change +uuid + + + + +dss_rental_listing_extractTable dss.dss_rental_listing_extract + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + A prebuilt report that is specific to a subset of rental listings + 🔑 Pk dss_rental_listing_extract_pk ( rental_listing_extract_id ) rental_listing_extract_id⧉ rental_listing_extract_id + * bigint + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Unique generated key +bigint rental_listing_extract_nm⧉ rental_listing_extract_nm + * varchar(250) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + A description of the information contained in the extract +varchar(250) is_pr_requirement_filtered⧉ is_pr_requirement_filtered + * boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates whether the report is filtered by jurisdictional principal residence requirement +boolean source_bin⧉ source_bin + bytea + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The binary image of the information in the report +bytea filtering_organization_id⧉ filtering_organization_id + bigint + ↗ dss_rental_listing_extract( organization_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Foreign key +bigint🔗 References dss_organization ( filtering_organization_id -> organization_id ) + upd_dtm⧉ upd_dtm + * timestamptz + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Trigger-updated timestamp of last change +timestamptz upd_user_guid⧉ upd_user_guid + uuid + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The globally unique identifier (assigned by the identity provider) for the most recent user to record a change +uuid + + + + +dss_rental_listing_reportTable dss.dss_rental_listing_report + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + A platform-specific collection of rental listing information that is relevant to a specific month + 🔑 Pk dss_rental_listing_report_pk ( rental_listing_report_id ) rental_listing_report_id⧉ rental_listing_report_id + * bigint + ↙ dss_rental_listing( rental_listing_report_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Unique generated key +bigint🔗 Referred by dss_rental_listing ( including_rental_listing_report_id -> rental_listing_report_id ) + 🔍 Unq dss_rental_listing_report_uk ( providing_organization_id, report_period_ym ) report_period_ym⧉ report_period_ym + * date + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The month to which the listing information is relevant (always set to the first day of the month) +date is_current⧉ is_current + * boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates whether the rental listing version is the most recent one reported by the platform +boolean 🔍 Unq dss_rental_listing_report_uk ( providing_organization_id, report_period_ym ) providing_organization_id⧉ providing_organization_id + * bigint + ↗ dss_rental_listing_report( organization_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Foreign key +bigint🔗 References dss_organization ( providing_organization_id -> organization_id ) + upd_dtm⧉ upd_dtm + * timestamptz + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Trigger-updated timestamp of last change +timestamptz upd_user_guid⧉ upd_user_guid + uuid + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The globally unique identifier (assigned by the identity provider) for the most recent user to record a change +uuid + + + + +dss_upload_deliveryTable dss.dss_upload_delivery + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + A delivery of uploaded information that is relevant to a specific month + 🔑 Pk dss_upload_delivery_pk ( upload_delivery_id ) upload_delivery_id⧉ upload_delivery_id + * bigint + ↙ dss_upload_line( upload_delivery_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Unique generated key +bigint🔗 Referred by dss_upload_line ( including_upload_delivery_id -> upload_delivery_id ) + upload_delivery_type⧉ upload_delivery_type + * varchar(25) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Identifies the treatment applied to ingesting the uploaded information +varchar(25) report_period_ym⧉ report_period_ym + date + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The month to which the delivery batch is relevant (always set to the first day of the month) +date source_hash_dsc⧉ source_hash_dsc + * varchar(256) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The hash value of the information that was uploaded +varchar(256) source_bin⧉ source_bin + bytea + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The binary image of the information that was uploaded +bytea source_header_txt⧉ source_header_txt + varchar(32000) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Full text of the header line +varchar(32000) providing_organization_id⧉ providing_organization_id + * bigint + ↗ dss_upload_delivery( organization_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Foreign key +bigint🔗 References dss_organization ( providing_organization_id -> organization_id ) + upd_dtm⧉ upd_dtm + * timestamptz + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Trigger-updated timestamp of last change +timestamptz upd_user_guid⧉ upd_user_guid + uuid + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The globally unique identifier (assigned by the identity provider) for the most recent user to record a change +uuid + + + + +dss_upload_lineTable dss.dss_upload_line + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + An upload delivery line that has been extracted from the source + 🔑 Pk dss_upload_line_pk ( upload_line_id ) upload_line_id⧉ upload_line_id + * bigint + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Unique generated key +bigint is_validation_failure⧉ is_validation_failure + * boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates that there has been a validation problem that prevents successful ingestion of the upload line +boolean is_system_failure⧉ is_system_failure + * boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates that a system fault has prevented complete ingestion of the upload line +boolean 🔍 dss_upload_line_i1 ( is_processed, including_upload_delivery_id ) is_processed⧉ is_processed + * boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates that no further ingestion attempt is required for the upload line +boolean 🔍 Unq dss_upload_line_uk ( including_upload_delivery_id, source_organization_cd, source_record_no ) source_organization_cd⧉ source_organization_cd + * varchar(25) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + An immutable system code identifying the organization who created the information in the upload line (e.g. AIRBNB) +varchar(25) 🔍 Unq dss_upload_line_uk ( including_upload_delivery_id, source_organization_cd, source_record_no ) source_record_no⧉ source_record_no + * varchar(50) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The immutable identification number for the source record, such as a rental listing number +varchar(50) source_line_txt⧉ source_line_txt + * varchar(32000) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Full text of the upload line +varchar(32000) error_txt⧉ error_txt + varchar(32000) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Freeform description of the problem found while attempting to interpret the report line +varchar(32000) 🔍 Unq dss_upload_line_uk ( including_upload_delivery_id, source_organization_cd, source_record_no ) 🔍 dss_upload_line_i1 ( is_processed, including_upload_delivery_id ) including_upload_delivery_id⧉ including_upload_delivery_id + * bigint + ↗ dss_upload_line( upload_delivery_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Foreign key +bigint🔗 References dss_upload_delivery ( including_upload_delivery_id -> upload_delivery_id ) + + + + + +dss_user_identityTable dss.dss_user_identity + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + An externally defined domain directory object representing a potential application user or group + 🔑 Pk dss_user_identity_pk ( user_identity_id ) user_identity_id⧉ user_identity_id + * bigint + ↙ dss_email_message( user_identity_id ) + ↙ dss_email_message( user_identity_id ) + ↙ dss_user_role_assignment( user_identity_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Unique generated key +bigint🔗 Referred by dss_email_message ( initiating_user_identity_id -> user_identity_id ) +Referred by dss_email_message ( affected_by_user_identity_id -> user_identity_id ) +Referred by dss_user_role_assignment ( user_identity_id ) + user_guid⧉ user_guid + * uuid + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + An immutable unique identifier assigned by the identity provider +uuid display_nm⧉ display_nm + * varchar(250) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + A human-readable full name that is assigned by the identity provider (this may include a preferred name and/or business unit name) +varchar(250) identity_provider_nm⧉ identity_provider_nm + * varchar(25) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + A directory or domain that authenticates system users to allow access to the application or its API (e.g. idir, bceidbusiness) +varchar(25) is_enabled⧉ is_enabled + * boolean + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Indicates whether access is currently permitted using this identity +boolean access_request_status_cd⧉ access_request_status_cd + * varchar(25) + ↗ dss_user_identity( access_request_status_cd ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The current status of the most recent access request made by the user (restricted to Requested, Approved, or Denied) +varchar(25)🔗 References dss_access_request_status ( access_request_status_cd ) + access_request_dtm⧉ access_request_dtm + timestamptz + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + A timestamp indicating when the most recent access request was made by the user +timestamptz access_request_justification_txt⧉ access_request_justification_txt + varchar(250) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The most recent user-provided reason for requesting application access +varchar(250) given_nm⧉ given_nm + varchar(25) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + A name given to a person so that they can easily be identified among their family members (in some cultures, this is often the first name) +varchar(25) family_nm⧉ family_nm + varchar(25) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + A name that is often shared amongst members of the same family (commonly known as a surname within some cultures) +varchar(25) email_address_dsc⧉ email_address_dsc + varchar(320) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + E-mail address associated with the user by the identity provider +varchar(320) business_nm⧉ business_nm + varchar(250) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + A human-readable organization name that is associated with the user by the identity provider +varchar(250) terms_acceptance_dtm⧉ terms_acceptance_dtm + timestamptz + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + A timestamp indicating when the user most recently accepted the published Terms and Conditions of application access +timestamptz represented_by_organization_id⧉ represented_by_organization_id + bigint + ↗ dss_user_identity( organization_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Foreign key +bigint🔗 References dss_organization ( represented_by_organization_id -> organization_id ) + upd_dtm⧉ upd_dtm + * timestamptz + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Trigger-updated timestamp of last change +timestamptz upd_user_guid⧉ upd_user_guid + uuid + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The globally unique identifier (assigned by the identity provider) for the most recent user to record a change +uuid + + + + +dss_user_privilegeTable dss.dss_user_privilege + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + A granular access right or privilege within the application that may be granted to a role + 🔑 Pk dss_user_privilege_pk ( user_privilege_cd ) user_privilege_cd⧉ user_privilege_cd + * varchar(25) + ↙ dss_user_role_privilege( user_privilege_cd ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The immutable system code that identifies the privilege +varchar(25)🔗 Referred by dss_user_role_privilege ( user_privilege_cd ) + user_privilege_nm⧉ user_privilege_nm + * varchar(250) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The human-readable name that is given for the role +varchar(250) + + + + +dss_user_roleTable dss.dss_user_role + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + A set of access rights and privileges within the application that may be granted to users + 🔑 Pk dss_user_role_pk ( user_role_cd ) user_role_cd⧉ user_role_cd + * varchar(25) + ↙ dss_user_role_assignment( user_role_cd ) + ↙ dss_user_role_privilege( user_role_cd ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The immutable system code that identifies the role +varchar(25)🔗 Referred by dss_user_role_assignment ( user_role_cd ) +Referred by dss_user_role_privilege ( user_role_cd ) + user_role_nm⧉ user_role_nm + * varchar(250) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The human-readable name that is given for the role +varchar(250) user_role_dsc⧉ user_role_dsc + varchar(200) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The human-readable description that is given for the role +varchar(200) upd_dtm⧉ upd_dtm + timestamptz + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Trigger-updated timestamp of last change +timestamptz upd_user_guid⧉ upd_user_guid + uuid + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The globally unique identifier (assigned by the identity provider) for the most recent user to record a change +uuid + + + + +dss_user_role_assignmentTable dss.dss_user_role_assignment + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The association of a grantee credential to a role for the purpose of conveying application privileges + 🔑 Pk dss_user_role_assignment_pk ( user_identity_id, user_role_cd ) user_identity_id⧉ user_identity_id + * bigint + ↗ dss_user_role_assignment( user_identity_id ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Foreign key +bigint🔗 References dss_user_identity ( user_identity_id ) + 🔑 Pk dss_user_role_assignment_pk ( user_identity_id, user_role_cd ) user_role_cd⧉ user_role_cd + * varchar(25) + ↗ dss_user_role_assignment( user_role_cd ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Foreign key +varchar(25)🔗 References dss_user_role ( user_role_cd ) + upd_dtm⧉ upd_dtm + timestamptz + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Trigger-updated timestamp of last change +timestamptz upd_user_guid⧉ upd_user_guid + uuid + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The globally unique identifier (assigned by the identity provider) for the most recent user to record a change +uuid + + + + +dss_user_role_privilegeTable dss.dss_user_role_privilege + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The association of a granular application privilege to a role + 🔑 Pk dss_user_role_privilege_pk ( user_privilege_cd, user_role_cd ) user_privilege_cd⧉ user_privilege_cd + * varchar(25) + ↗ dss_user_role_privilege( user_privilege_cd ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Foreign key +varchar(25)🔗 References dss_user_privilege ( user_privilege_cd ) + 🔑 Pk dss_user_role_privilege_pk ( user_privilege_cd, user_role_cd ) user_role_cd⧉ user_role_cd + * varchar(25) + ↗ dss_user_role_privilege( user_role_cd ) + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Foreign key +varchar(25)🔗 References dss_user_role ( user_role_cd ) + upd_dtm⧉ upd_dtm + timestamptz + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + Trigger-updated timestamp of last change +timestamptz upd_user_guid⧉ upd_user_guid + uuid + ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ + The globally unique identifier (assigned by the identity provider) for the most recent user to record a change +uuid + + + + Ministry of Housing + Short Term Rental Data Sharing + Physical Data Diagram (Sprint 14) + Leif Larsen, DXC Technology + September 18, 2024 + + \ No newline at end of file diff --git a/database/model/STR_DSS_Physical_DB_Design_Sprint_14.md b/database/model/STR_DSS_Physical_DB_Design_Sprint_14.md new file mode 100644 index 00000000..3fc9aa1b --- /dev/null +++ b/database/model/STR_DSS_Physical_DB_Design_Sprint_14.md @@ -0,0 +1,789 @@ +#Physical Data Diagram (Sprint 14) +Generated using [DbSchema](https://dbschema.com) + + + + +### Physical Data Diagram (Sprint 14) +![img](./PhysicalDataDiagram(Sprint14).svg) + + + +### Table dss.dss_access_request_status +A potential status for a user access request (e.g. Requested, Approved, or Denied) + +|Idx |Name |Data Type |Description | +|---|---|---|---| +| * 🔑 ⬋ | access\_request\_status\_cd| varchar(25) | System-consistent code for the request status | +| * | access\_request\_status\_nm| varchar(250) | Business term for the request status | + + +##### Indexes +|Type |Name |On | +|---|---|---| +| 🔑 | dss\_access\_request\_status\_pk | ON access\_request\_status\_cd| + + + +### Table dss.dss_business_licence +|Idx |Name |Data Type |Description | +|---|---|---|---| +| * 🔑 ⬋ | business\_licence\_id| bigint GENERATED ALWAYS AS IDENTITY | Unique generated key | +| * 🔍 | business\_licence\_no| varchar(50) | The local government issued licence number that applies to the rental offering | +| * | expiry\_dt| date | The date on which the business licence expires | +| 🔎 | physical\_rental\_address\_txt| varchar(250) | The full physical address of the location that is licenced as a short-term rental business | +| | licence\_type\_txt| varchar(320) | Free form description of the type of business licence issued (e.g. short-term rental, bed and breakfast, boarding and lodging, tourist accommodation) | +| | restriction\_txt| varchar(320) | Notes related to any restrictions associated with the licence | +| | business\_nm| varchar(320) | Official name of the business | +| | mailing\_street\_address\_txt| varchar(100) | Street address component of the business mailing address | +| | mailing\_city\_nm| varchar(100) | City component of the business mailing address | +| | mailing\_province\_cd| varchar(2) | Province component of the business mailing address | +| | mailing\_postal\_cd| varchar(10) | Postal code component of the business mailing address | +| | business\_owner\_nm| varchar(320) | Full name of the registered business owner | +| | business\_owner\_phone\_no| varchar(30) | Phone number of the business owner | +| | business\_owner\_email\_address\_dsc| varchar(320) | Email address of the business owner | +| | business\_operator\_nm| varchar(320) | Full name of the business operator or property manager | +| | business\_operator\_phone\_no| varchar(30) | Phone number of the business operator | +| | business\_operator\_email\_address\_dsc| varchar(320) | Email address of the business operator | +| | infraction\_txt| varchar(320) | Description of an infraction | +| | infraction\_dt| date | The date on which the described infraction occurred | +| | property\_zone\_txt| varchar(100) | Description or name of the property zoning | +| | available\_bedrooms\_qty| smallint | The number of bedrooms in the dwelling unit that are available for short term rental | +| | max\_guests\_allowed\_qty| smallint | The number of guests that can be accommodated | +| | is\_principal\_residence| boolean | Indicates whether the short term rental property is a principal residence | +| | is\_owner\_living\_onsite| boolean | Indicates whether the owner lives on the property | +| | is\_owner\_property\_tenant| boolean | Indicates whether the business owner rents the property | +| | property\_folio\_no| varchar(30) | The number used to identify the property | +| | property\_parcel\_identifier\_no| varchar(30) | The PID number assigned by the Land Title and Survey Authority that identifies the piece of land | +| | property\_legal\_description\_txt| varchar(320) | The physical description of the property as it is registered with the Land Title and Survey Authority | +| * 🔎 ⬈ | licence\_status\_type| varchar(25) | Foreign key | +| * 🔍 ⬈ | providing\_organization\_id| bigint | Foreign key | +| 🔎 ⬈ | affected\_by\_physical\_address\_id| bigint | Foreign key | +| * | upd\_dtm| timestamptz | Trigger-updated timestamp of last change | +| | upd\_user\_guid| uuid | The globally unique identifier (assigned by the identity provider) for the most recent user to record a change | + + +##### Indexes +|Type |Name |On | +|---|---|---| +| 🔑 | dss\_business\_licence\_pk | ON business\_licence\_id| +| 🔎 | dss\_business\_licence\_i2 | ON affected\_by\_physical\_address\_id| +| 🔍 | dss\_business\_licence\_uk | ON providing\_organization\_id, business\_licence\_no| +| 🔎 | dss\_business\_licence\_i1 | ON licence\_status\_type| +| 🔎 | dss\_business\_licence\_i3 | ON physical\_rental\_address\_txt| + +##### Foreign Keys +|Type |Name |On | +|---|---|---| +| | dss_business_licence_fk_provided_by | ( providing\_organization\_id ) ref [dss.dss\_organization](#dss\_organization) (organization\_id) | +| | dss_business_licence_fk_affecting | ( affected\_by\_physical\_address\_id ) ref [dss.dss\_physical\_address](#dss\_physical\_address) (physical\_address\_id) | +| | dss_business_licence_fk_classified_as | ( licence\_status\_type ) ref [dss.dss\_business\_licence\_status\_type](#dss\_business\_licence\_status\_type) (licence\_status\_type) | + + +##### Triggers +|Name |Definition | +|---|---| +### Trigger dss_business_licence_br_iu_tr + + ``` +CREATE TRIGGER dss\_business\_licence\_br\_iu\_tr BEFORE INSERT OR UPDATE ON dss.dss\_business\_licence FOR EACH ROW EXECUTE FUNCTION dss.dss\_update\_audit\_columns() +``` + + +### Table dss.dss_business_licence_status_type +A potential status for a BUSINESS LICENCE (e.g. Pending, Issued, Suspended, Revoked, Cancelled, Expired) + +|Idx |Name |Data Type |Description | +|---|---|---|---| +| * 🔑 ⬋ | licence\_status\_type| varchar(25) | System-consistent code for the business licence status (e.g. Pending, Issued, Suspended, Revoked, Cancelled, Expired) | +| * | licence\_status\_type\_nm| varchar(50) | Business term for the licence status (e.g. Pending, Issued, Suspended, Revoked, Cancelled, Expired) | +| * | licence\_status\_sort\_no| smallint | Relative order in which the business prefers to see the status listed | + + +##### Indexes +|Type |Name |On | +|---|---|---| +| 🔑 | dss\_business\_licence\_status\_type\_pk | ON licence\_status\_type| + + + +### Table dss.dss_email_message +A message that is sent to one or more recipients via email + +|Idx |Name |Data Type |Description | +|---|---|---|---| +| * 🔑 ⬋ | email\_message\_id| bigint GENERATED ALWAYS AS IDENTITY | Unique generated key | +| * ⬈ | email\_message\_type| varchar(50) | Foreign key | +| * 🔎 | message\_delivery\_dtm| timestamptz | A timestamp indicating when the message delivery was initiated | +| * | message\_template\_dsc| varchar(4000) | The full text or template for the message that is sent | +| * | is\_submitter\_cc\_required| boolean | Indicates whether the user initiating the message should receive a copy of the email | +| | is\_host\_contacted\_externally| boolean | Indicates whether the the property host has already been contacted by external means | +| | is\_with\_standard\_detail| boolean | Indicates whether message body should include text a block of detail text that is standard for the message type | +| | lg\_phone\_no| varchar(30) | A phone number associated with a Local Government contact | +| | unreported\_listing\_no| varchar(50) | The platform issued identification number for the listing (if not included in a rental listing report) | +| | host\_email\_address\_dsc| varchar(320) | E-mail address of a short term rental host (directly entered by the user as a message recipient) | +| | lg\_email\_address\_dsc| varchar(320) | E-mail address of a local government contact (directly entered by the user as a message recipient) | +| | cc\_email\_address\_dsc| varchar(4000) | E-mail address of a secondary message recipient (directly entered by the user) | +| | unreported\_listing\_url| varchar(4000) | User-provided URL for a short-term rental platform listing that is the subject of the message | +| | lg\_str\_bylaw\_url| varchar(4000) | User-provided URL for a local government bylaw that is the subject of the message | +| | custom\_detail\_txt| varchar(4000) | Free form text that should be included in the message body | +| 🔎 ⬈ | concerned\_with\_rental\_listing\_id| bigint | Foreign key | +| ⬈ | initiating\_user\_identity\_id| bigint | Foreign key | +| ⬈ | affected\_by\_user\_identity\_id| bigint | Foreign key | +| ⬈ | involved\_in\_organization\_id| bigint | Foreign key | +| ⬈ | batching\_email\_message\_id| bigint | Foreign key | +| ⬈ | requesting\_organization\_id| bigint | Foreign key | +| | external\_message\_no| varchar(50) | External identifier for tracking the message delivery progress | +| | upd\_dtm| timestamptz | Trigger-updated timestamp of last change | +| | upd\_user\_guid| uuid | The globally unique identifier (assigned by the identity provider) for the most recent user to record a change | + + +##### Indexes +|Type |Name |On | +|---|---|---| +| 🔑 | dss\_email\_message\_pk | ON email\_message\_id| +| 🔎 | dss\_email\_message\_i1 | ON concerned\_with\_rental\_listing\_id, message\_delivery\_dtm| + +##### Foreign Keys +|Type |Name |On | +|---|---|---| +| | dss_email_message_fk_initiated_by | ( initiating\_user\_identity\_id ) ref [dss.dss\_user\_identity](#dss\_user\_identity) (user\_identity\_id) | +| | dss_email_message_fk_affecting | ( affected\_by\_user\_identity\_id ) ref [dss.dss\_user\_identity](#dss\_user\_identity) (user\_identity\_id) | +| | dss_email_message_fk_involving | ( involved\_in\_organization\_id ) ref [dss.dss\_organization](#dss\_organization) (organization\_id) | +| | dss_email_message_fk_communicating | ( email\_message\_type ) ref [dss.dss\_email\_message\_type](#dss\_email\_message\_type) (email\_message\_type) | +| | dss_email_message_fk_batched_in | ( batching\_email\_message\_id ) ref [dss.dss\_email\_message](#dss\_email\_message) (email\_message\_id) | +| | dss_email_message_fk_requested_by | ( requesting\_organization\_id ) ref [dss.dss\_organization](#dss\_organization) (organization\_id) | +| | dss_email_message_fk_included_in | ( concerned\_with\_rental\_listing\_id ) ref [dss.dss\_rental\_listing](#dss\_rental\_listing) (rental\_listing\_id) | + + +##### Triggers +|Name |Definition | +|---|---| +### Trigger dss_email_message_br_iu_tr + + ``` +CREATE TRIGGER dss\_email\_message\_br\_iu\_tr BEFORE INSERT OR UPDATE ON dss.dss\_email\_message FOR EACH ROW EXECUTE FUNCTION dss.dss\_update\_audit\_columns() +``` + + +### Table dss.dss_email_message_type +The type or purpose of a system generated message (e.g. Notice of Takedown, Takedown Request, Delisting Warning, Delisting Request, Access Granted Notification, Access Denied Notification) + +|Idx |Name |Data Type |Description | +|---|---|---|---| +| * 🔑 ⬋ | email\_message\_type| varchar(50) | System-consistent code for the type or purpose of the message (e.g. Notice of Takedown, Takedown Request, Delisting Warning, Delisting Request, Access Granted Notification, Access Denied Notification) | +| * | email\_message\_type\_nm| varchar(250) | Business term for the type or purpose of the message (e.g. Notice of Takedown, Takedown Request, Delisting Warning, Delisting Request, Access Granted Notification, Access Denied Notification) | + + +##### Indexes +|Type |Name |On | +|---|---|---| +| 🔑 | dss\_email\_message\_type\_pk | ON email\_message\_type| + + + +### Table dss.dss_listing_status_type +A potential status for a CURRENT RENTAL LISTING (e.g. New, Active, Inactive, Reassigned, Taken Down) + +|Idx |Name |Data Type |Description | +|---|---|---|---| +| * 🔑 ⬋ | listing\_status\_type| varchar(2) | System-consistent code for the listing status (e.g. N, A, I, R, T) | +| * | listing\_status\_type\_nm| varchar(50) | Business term for the listing status (e.g. New, Active, Inactive, Reassigned, Taken Down) | +| * | listing\_status\_sort\_no| smallint | Relative order in which the business prefers to see the status listed | + + +##### Indexes +|Type |Name |On | +|---|---|---| +| 🔑 | dss\_listing\_status\_type\_pk | ON listing\_status\_type| + + + +### Table dss.dss_organization +A private company or governing body component that plays a role in short term rental reporting or enforcement + +|Idx |Name |Data Type |Description | +|---|---|---|---| +| * 🔑 ⬋ | organization\_id| bigint GENERATED ALWAYS AS IDENTITY | Unique generated key | +| * 🔎 ⬈ | organization\_type| varchar(25) | Foreign key | +| * 🔍 | organization\_cd| varchar(25) | An immutable system code that identifies the organization (e.g. CEU, AIRBNB) | +| * | organization\_nm| varchar(250) | A human-readable name that identifies the organization (e.g. Corporate Enforecement Unit, City of Victoria) | +| | local\_government\_type| varchar(50) | A sub-type of local government organization used for sorting and grouping or members | +| | economic\_region\_dsc| varchar(100) | A free form description of the economic region to which a Local Government Subdivision belongs | +| | is\_lg\_participating| boolean | Indicates whether a LOCAL GOVERNMENT ORGANIZATION participates in Short Term Rental Data Sharing | +| | is\_str\_prohibited| boolean | Indicates whether a LOCAL GOVERNMENT ORGANIZATION entirely prohibits short term housing rentals | +| | is\_principal\_residence\_required| boolean | Indicates whether a LOCAL GOVERNMENT SUBDIVISION is subject to Provincial Principal Residence Short Term Rental restrictions | +| | is\_business\_licence\_required| boolean | Indicates whether a LOCAL GOVERNMENT SUBDIVISION requires a business licence for Short Term Rental operation | +| | area\_geometry| geometry | the multipolygon shape identifying the boundaries of a local government subdivision | +| 🔎 ⬈ | managing\_organization\_id| bigint | Self-referential hierarchical foreign key | +| * | upd\_dtm| timestamptz | Trigger-updated timestamp of last change | +| | upd\_user\_guid| uuid | The globally unique identifier (assigned by the identity provider) for the most recent user to record a change | + + +##### Indexes +|Type |Name |On | +|---|---|---| +| 🔑 | dss\_organization\_pk | ON organization\_id| +| 🔎 | dss\_organization\_i1 | ON organization\_type| +| 🔍 | dss\_organization\_uk | ON organization\_cd| +| 🔎 | dss\_organization\_i2 | ON managing\_organization\_id| + +##### Foreign Keys +|Type |Name |On | +|---|---|---| +| | dss_organization_fk_managed_by | ( managing\_organization\_id ) ref [dss.dss\_organization](#dss\_organization) (organization\_id) | +| | dss_organization_fk_treated_as | ( organization\_type ) ref [dss.dss\_organization\_type](#dss\_organization\_type) (organization\_type) | + + +##### Triggers +|Name |Definition | +|---|---| +### Trigger dss_organization_br_iu_tr + + ``` +CREATE TRIGGER dss\_organization\_br\_iu\_tr BEFORE INSERT OR UPDATE ON dss.dss\_organization FOR EACH ROW EXECUTE FUNCTION dss.dss\_update\_audit\_columns() +``` + + +### Table dss.dss_organization_contact_person +A person who has been identified as a notable contact for a particular organization + +|Idx |Name |Data Type |Description | +|---|---|---|---| +| * 🔑 | organization\_contact\_person\_id| bigint GENERATED ALWAYS AS IDENTITY | Unique generated key | +| * | email\_address\_dsc| varchar(320) | E-mail address given for the contact by the organization | +| | is\_primary| boolean | Indicates whether the contact should receive all communications directed at the organization | +| | given\_nm| varchar(25) | A name given to a person so that they can easily be identified among their family members (in some cultures, this is often the first name) | +| | family\_nm| varchar(25) | A name that is often shared amongst members of the same family (commonly known as a surname within some cultures) | +| | phone\_no| varchar(30) | Phone number given for the contact by the organization (contains only digits) | +| * ⬈ | contacted\_through\_organization\_id| bigint | Foreign key | +| ⬈ | email\_message\_type| varchar(50) | Foreign key | +| * | upd\_dtm| timestamptz | Trigger-updated timestamp of last change | +| | upd\_user\_guid| uuid | The globally unique identifier (assigned by the identity provider) for the most recent user to record a change | + + +##### Indexes +|Type |Name |On | +|---|---|---| +| 🔑 | dss\_organization\_contact\_person\_pk | ON organization\_contact\_person\_id| + +##### Foreign Keys +|Type |Name |On | +|---|---|---| +| | dss_organization_contact_person_fk_contacted_for | ( contacted\_through\_organization\_id ) ref [dss.dss\_organization](#dss\_organization) (organization\_id) | +| | dss_organization_contact_person_fk_subscribed_to | ( email\_message\_type ) ref [dss.dss\_email\_message\_type](#dss\_email\_message\_type) (email\_message\_type) | + + +##### Triggers +|Name |Definition | +|---|---| +### Trigger dss_organization_contact_person_br_iu_tr + + ``` +CREATE TRIGGER dss\_organization\_contact\_person\_br\_iu\_tr BEFORE INSERT OR UPDATE ON dss.dss\_organization\_contact\_person FOR EACH ROW EXECUTE FUNCTION dss.dss\_update\_audit\_columns() +``` + + +### Table dss.dss_organization_type +A level of government or business category + +|Idx |Name |Data Type |Description | +|---|---|---|---| +| * 🔑 ⬋ | organization\_type| varchar(25) | System-consistent code for a level of government or business category | +| * | organization\_type\_nm| varchar(250) | Business term for a level of government or business category | + + +##### Indexes +|Type |Name |On | +|---|---|---| +| 🔑 | dss\_organization\_type\_pk | ON organization\_type| + + + +### Table dss.dss_physical_address +A property address that includes any verifiable BC attributes + +|Idx |Name |Data Type |Description | +|---|---|---|---| +| * 🔑 ⬋ | physical\_address\_id| bigint GENERATED ALWAYS AS IDENTITY | Unique generated key | +| * 🔎 | original\_address\_txt| varchar(250) | The source-provided address of a short-term rental offering | +| | match\_result\_json| json | Full JSON result of the source address matching attempt | +| 🔎 | match\_address\_txt| varchar(250) | The sanitized physical address (returned as fullAddress) that has been derived from the original | +| | match\_score\_amt| smallint | The relative score returned from the address matching attempt | +| | unit\_no| varchar(50) | The unitNumber (suite) returned by the address match (e.g. 100) | +| | civic\_no| varchar(50) | The civicNumber (building number) returned by the address match (e.g. 1285) | +| | street\_nm| varchar(100) | The streetName returned by the address match (e.g. Pender) | +| | street\_type\_dsc| varchar(50) | The streetType returned by the address match (e.g. St or Street) | +| | street\_direction\_dsc| varchar(50) | The streetDirection returned by the address match (e.g. W or West) | +| | locality\_nm| varchar(100) | The localityName (community) returned by the address match (e.g. Vancouver) | +| | locality\_type\_dsc| varchar(50) | The localityType returned by the address match (e.g. City) | +| | province\_cd| varchar(5) | The provinceCode returned by the address match | +| | site\_no| varchar(50) | The siteID returned by the address match | +| | block\_no| varchar(50) | The blockID returned by the address match | +| | location\_geometry| geometry | The computed location point of the matched address | +| | is\_exempt| boolean | Indicates whether the address has been identified as exempt from Short Term Rental regulations | +| | is\_match\_verified| boolean | Indicates whether the matched address has been verified as correct for the listing by the responsible authorities | +| | is\_changed\_original\_address| boolean | Indicates whether the original address has received a different property address from the platform in the last reporting period | +| | is\_match\_corrected| boolean | Indicates whether the matched address has been manually changed to one that is verified as correct for the listing | +| | is\_system\_processing| boolean | Indicates whether the physical address is being processed by the system and may not yet be in its final form | +| 🔎 ⬈ | containing\_organization\_id| bigint | Foreign key | +| ⬈ | replacing\_physical\_address\_id| bigint | Foreign key | +| * | upd\_dtm| timestamptz | Trigger-updated timestamp of last change | +| | upd\_user\_guid| uuid | The globally unique identifier (assigned by the identity provider) for the most recent user to record a change | + + +##### Indexes +|Type |Name |On | +|---|---|---| +| 🔑 | dss\_physical\_address\_pk | ON physical\_address\_id| +| 🔎 | dss\_physical\_address\_i1 | ON original\_address\_txt| +| 🔎 | dss\_physical\_address\_i2 | ON match\_address\_txt| +| 🔎 | dss\_physical\_address\_i3 | ON containing\_organization\_id| + +##### Foreign Keys +|Type |Name |On | +|---|---|---| +| | dss_physical_address_fk_contained_in | ( containing\_organization\_id ) ref [dss.dss\_organization](#dss\_organization) (organization\_id) | +| | dss_physical_address_fk_replaced_by | ( replacing\_physical\_address\_id ) ref [dss.dss\_physical\_address](#dss\_physical\_address) (physical\_address\_id) | + + +##### Triggers +|Name |Definition | +|---|---| +### Trigger dss_physical_address_br_iu_tr + + ``` +CREATE TRIGGER dss\_physical\_address\_br\_iu\_tr BEFORE INSERT OR UPDATE ON dss.dss\_physical\_address FOR EACH ROW EXECUTE FUNCTION dss.dss\_update\_audit\_columns() +``` + + +### Table dss.dss_rental_listing +A rental listing snapshot that is either relevant to a specific monthly report, or is the current, master version + +|Idx |Name |Data Type |Description | +|---|---|---|---| +| * 🔑 ⬋ | rental\_listing\_id| bigint GENERATED ALWAYS AS IDENTITY | Unique generated key | +| * 🔎 | platform\_listing\_no| varchar(50) | The platform issued identification number for the listing | +| | platform\_listing\_url| varchar(4000) | URL for the short-term rental platform listing | +| 🔎 | business\_licence\_no| varchar(320) | The business licence number that is published for the rental offering | +| 🔎 | effective\_business\_licence\_no| varchar(320) | The local government issued licence number that should be used for compariing the rental offering with others | +| 🔎 | effective\_host\_nm| varchar(320) | The full name of the rental offering host that should be used for comparison with others | +| | bc\_registry\_no| varchar(50) | The Short Term Registry issued permit number | +| * | is\_current| boolean | Indicates whether the RENTAL LISTING VERSION is a CURRENT RENTAL LISTING (if it is a copy of the most current REPORTED RENTAL LISTING (having the same listing number for the same offering platform) | +| | is\_active| boolean | Indicates whether a CURRENT RENTAL LISTING was included in the most recent RENTAL LISTING REPORT | +| | is\_new| boolean | Indicates whether a CURRENT RENTAL LISTING appeared for the first time in the last reporting period | +| | is\_taken\_down| boolean | Indicates whether a CURRENT RENTAL LISTING has been reported as taken down by the offering platform | +| | is\_changed\_original\_address| boolean | Indicates whether a CURRENT RENTAL LISTING has received a different property address in the last reporting period | +| | is\_changed\_address| boolean | Indicates whether a CURRENT RENTAL LISTING has been subjected to address match changes by a user | +| | is\_lg\_transferred| boolean | Indicates whether a CURRENT RENTAL LISTING has been transferred to a different Local Goverment Organization as a result of address changes | +| | is\_changed\_business\_licence| boolean | Indicates whether a CURRENT RENTAL LISTING has been subjected to business licence linking changes by a user | +| | is\_entire\_unit| boolean | Indicates whether the entire dwelling unit is offered for rental (as opposed to a single bedroom) | +| 🔎 | lg\_transfer\_dtm| timestamptz | Indicates when a CURRENT RENTAL LISTING was most recently transferred to a different Local Goverment Organization as a result of address changes | +| | available\_bedrooms\_qty| smallint | The number of bedrooms in the dwelling unit that are available for short term rental | +| | nights\_booked\_qty| smallint | The number of nights that short term rental accommodation services were provided during the reporting period | +| | separate\_reservations\_qty| smallint | The number of separate reservations that were taken during the reporting period | +| * 🔎 ⬈ | offering\_organization\_id| bigint | Foreign key | +| 🔎 ⬈ | including\_rental\_listing\_report\_id| bigint | Foreign key | +| 🔎 ⬈ | derived\_from\_rental\_listing\_id| bigint | Foreign key | +| 🔎 ⬈ | locating\_physical\_address\_id| bigint | Foreign key | +| 🔎 ⬈ | governing\_business\_licence\_id| bigint | Foreign key | +| 🔎 ⬈ | listing\_status\_type| varchar(2) | Foreign key | +| * | upd\_dtm| timestamptz | Trigger-updated timestamp of last change | +| | upd\_user\_guid| uuid | The globally unique identifier (assigned by the identity provider) for the most recent user to record a change | + + +##### Indexes +|Type |Name |On | +|---|---|---| +| 🔑 | dss\_rental\_listing\_pk | ON rental\_listing\_id| +| 🔎 | dss\_rental\_listing\_i1 | ON offering\_organization\_id, platform\_listing\_no| +| 🔎 | dss\_rental\_listing\_i2 | ON including\_rental\_listing\_report\_id| +| 🔎 | dss\_rental\_listing\_i3 | ON derived\_from\_rental\_listing\_id| +| 🔎 | dss\_rental\_listing\_i4 | ON locating\_physical\_address\_id| +| 🔎 | dss\_rental\_listing\_i5 | ON listing\_status\_type, offering\_organization\_id| +| 🔎 | dss\_rental\_listing\_i6 | ON governing\_business\_licence\_id| +| 🔎 | dss\_rental\_listing\_i7 | ON business\_licence\_no| +| 🔎 | dss\_rental\_listing\_i8 | ON effective\_business\_licence\_no| +| 🔎 | dss\_rental\_listing\_i9 | ON effective\_host\_nm| +| 🔎 | dss\_rental\_listing\_i11 | ON lg\_transfer\_dtm| + +##### Foreign Keys +|Type |Name |On | +|---|---|---| +| | dss_rental_listing_fk_offered_by | ( offering\_organization\_id ) ref [dss.dss\_organization](#dss\_organization) (organization\_id) | +| | dss_rental_listing_fk_included_in | ( including\_rental\_listing\_report\_id ) ref [dss.dss\_rental\_listing\_report](#dss\_rental\_listing\_report) (rental\_listing\_report\_id) | +| | dss_rental_listing_fk_located_at | ( locating\_physical\_address\_id ) ref [dss.dss\_physical\_address](#dss\_physical\_address) (physical\_address\_id) | +| | dss_rental_listing_fk_generating | ( derived\_from\_rental\_listing\_id ) ref [dss.dss\_rental\_listing](#dss\_rental\_listing) (rental\_listing\_id) | +| | dss_rental_listing_fk_classified_as | ( listing\_status\_type ) ref [dss.dss\_listing\_status\_type](#dss\_listing\_status\_type) (listing\_status\_type) | +| | dss_rental_listing_fk_governed_by | ( governing\_business\_licence\_id ) ref [dss.dss\_business\_licence](#dss\_business\_licence) (business\_licence\_id) | + + +##### Triggers +|Name |Definition | +|---|---| +### Trigger dss_rental_listing_br_iu_tr + + ``` +CREATE TRIGGER dss\_rental\_listing\_br\_iu\_tr BEFORE INSERT OR UPDATE ON dss.dss\_rental\_listing FOR EACH ROW EXECUTE FUNCTION dss.dss\_update\_audit\_columns() +``` + + +### Table dss.dss_rental_listing_contact +A person who has been identified as a notable contact for a particular rental listing + +|Idx |Name |Data Type |Description | +|---|---|---|---| +| * 🔑 | rental\_listing\_contact\_id| bigint GENERATED ALWAYS AS IDENTITY | Unique generated key | +| * | is\_property\_owner| boolean | Indicates a person with the legal right to the unit being short-term rental | +| | listing\_contact\_nbr| smallint | Indicates which of the five possible supplier hosts is represented by this contact | +| | supplier\_host\_no| varchar(50) | The platform identifier for the supplier host | +| | full\_nm| varchar(320) | The full name of the contact person as included in the listing | +| | phone\_no| varchar(30) | Phone number given for the contact | +| | fax\_no| varchar(30) | Facsimile numbrer given for the contact | +| | full\_address\_txt| varchar(250) | Mailing address given for the contact | +| | email\_address\_dsc| varchar(320) | E-mail address given for the contact | +| * 🔎 ⬈ | contacted\_through\_rental\_listing\_id| bigint | Foreign key | +| * | upd\_dtm| timestamptz | Trigger-updated timestamp of last change | +| | upd\_user\_guid| uuid | The globally unique identifier (assigned by the identity provider) for the most recent user to record a change | + + +##### Indexes +|Type |Name |On | +|---|---|---| +| 🔑 | dss\_rental\_listing\_contact\_pk | ON rental\_listing\_contact\_id| +| 🔎 | dss\_rental\_listing\_contact\_i1 | ON contacted\_through\_rental\_listing\_id| + +##### Foreign Keys +|Type |Name |On | +|---|---|---| +| | dss_rental_listing_contact_fk_contacted_for | ( contacted\_through\_rental\_listing\_id ) ref [dss.dss\_rental\_listing](#dss\_rental\_listing) (rental\_listing\_id) | + + +##### Triggers +|Name |Definition | +|---|---| +### Trigger dss_rental_listing_contact_br_iu_tr + + ``` +CREATE TRIGGER dss\_rental\_listing\_contact\_br\_iu\_tr BEFORE INSERT OR UPDATE ON dss.dss\_rental\_listing\_contact FOR EACH ROW EXECUTE FUNCTION dss.dss\_update\_audit\_columns() +``` + + +### Table dss.dss_rental_listing_extract +A prebuilt report that is specific to a subset of rental listings + +|Idx |Name |Data Type |Description | +|---|---|---|---| +| * 🔑 | rental\_listing\_extract\_id| bigint GENERATED ALWAYS AS IDENTITY | Unique generated key | +| * | rental\_listing\_extract\_nm| varchar(250) | A description of the information contained in the extract | +| * | is\_pr\_requirement\_filtered| boolean | Indicates whether the report is filtered by jurisdictional principal residence requirement | +| | source\_bin| bytea | The binary image of the information in the report | +| ⬈ | filtering\_organization\_id| bigint | Foreign key | +| * | upd\_dtm| timestamptz | Trigger-updated timestamp of last change | +| | upd\_user\_guid| uuid | The globally unique identifier (assigned by the identity provider) for the most recent user to record a change | + + +##### Indexes +|Type |Name |On | +|---|---|---| +| 🔑 | dss\_rental\_listing\_extract\_pk | ON rental\_listing\_extract\_id| + +##### Foreign Keys +|Type |Name |On | +|---|---|---| +| | dss_rental_listing_extract_fk_filtered_by | ( filtering\_organization\_id ) ref [dss.dss\_organization](#dss\_organization) (organization\_id) | + + +##### Triggers +|Name |Definition | +|---|---| +### Trigger dss_rental_listing_extract_br_iu_tr + + ``` +CREATE TRIGGER dss\_rental\_listing\_extract\_br\_iu\_tr BEFORE INSERT OR UPDATE ON dss.dss\_rental\_listing\_extract FOR EACH ROW EXECUTE FUNCTION dss.dss\_update\_audit\_columns() +``` + + +### Table dss.dss_rental_listing_report +A platform-specific collection of rental listing information that is relevant to a specific month + +|Idx |Name |Data Type |Description | +|---|---|---|---| +| * 🔑 ⬋ | rental\_listing\_report\_id| bigint GENERATED ALWAYS AS IDENTITY | Unique generated key | +| * 🔍 | report\_period\_ym| date | The month to which the listing information is relevant (always set to the first day of the month) | +| * | is\_current| boolean | Indicates whether the rental listing version is the most recent one reported by the platform | +| * 🔍 ⬈ | providing\_organization\_id| bigint | Foreign key | +| * | upd\_dtm| timestamptz | Trigger-updated timestamp of last change | +| | upd\_user\_guid| uuid | The globally unique identifier (assigned by the identity provider) for the most recent user to record a change | + + +##### Indexes +|Type |Name |On | +|---|---|---| +| 🔑 | dss\_rental\_listing\_report\_pk | ON rental\_listing\_report\_id| +| 🔍 | dss\_rental\_listing\_report\_uk | ON providing\_organization\_id, report\_period\_ym| + +##### Foreign Keys +|Type |Name |On | +|---|---|---| +| | dss_rental_listing_report_fk_provided_by | ( providing\_organization\_id ) ref [dss.dss\_organization](#dss\_organization) (organization\_id) | + + +##### Triggers +|Name |Definition | +|---|---| +### Trigger dss_rental_listing_report_br_iu_tr + + ``` +CREATE TRIGGER dss\_rental\_listing\_report\_br\_iu\_tr BEFORE INSERT OR UPDATE ON dss.dss\_rental\_listing\_report FOR EACH ROW EXECUTE FUNCTION dss.dss\_update\_audit\_columns() +``` + + +### Table dss.dss_upload_delivery +A delivery of uploaded information that is relevant to a specific month + +|Idx |Name |Data Type |Description | +|---|---|---|---| +| * 🔑 ⬋ | upload\_delivery\_id| bigint GENERATED ALWAYS AS IDENTITY | Unique generated key | +| * | upload\_delivery\_type| varchar(25) | Identifies the treatment applied to ingesting the uploaded information | +| | report\_period\_ym| date | The month to which the delivery batch is relevant (always set to the first day of the month) | +| * | source\_hash\_dsc| varchar(256) | The hash value of the information that was uploaded | +| | source\_bin| bytea | The binary image of the information that was uploaded | +| | source\_header\_txt| varchar(32000) | Full text of the header line | +| * ⬈ | providing\_organization\_id| bigint | Foreign key | +| * | upd\_dtm| timestamptz | Trigger-updated timestamp of last change | +| | upd\_user\_guid| uuid | The globally unique identifier (assigned by the identity provider) for the most recent user to record a change | + + +##### Indexes +|Type |Name |On | +|---|---|---| +| 🔑 | dss\_upload\_delivery\_pk | ON upload\_delivery\_id| + +##### Foreign Keys +|Type |Name |On | +|---|---|---| +| | dss_upload_delivery_fk_provided_by | ( providing\_organization\_id ) ref [dss.dss\_organization](#dss\_organization) (organization\_id) | + + +##### Triggers +|Name |Definition | +|---|---| +### Trigger dss_upload_delivery_br_iu_tr + + ``` +CREATE TRIGGER dss\_upload\_delivery\_br\_iu\_tr BEFORE INSERT OR UPDATE ON dss.dss\_upload\_delivery FOR EACH ROW EXECUTE FUNCTION dss.dss\_update\_audit\_columns() +``` + + +### Table dss.dss_upload_line +An upload delivery line that has been extracted from the source + +|Idx |Name |Data Type |Description | +|---|---|---|---| +| * 🔑 | upload\_line\_id| bigint GENERATED ALWAYS AS IDENTITY | Unique generated key | +| * | is\_validation\_failure| boolean | Indicates that there has been a validation problem that prevents successful ingestion of the upload line | +| * | is\_system\_failure| boolean | Indicates that a system fault has prevented complete ingestion of the upload line | +| * 🔎 | is\_processed| boolean | Indicates that no further ingestion attempt is required for the upload line | +| * 🔍 | source\_organization\_cd| varchar(25) | An immutable system code identifying the organization who created the information in the upload line (e.g. AIRBNB) | +| * 🔍 | source\_record\_no| varchar(50) | The immutable identification number for the source record, such as a rental listing number | +| * | source\_line\_txt| varchar(32000) | Full text of the upload line | +| | error\_txt| varchar(32000) | Freeform description of the problem found while attempting to interpret the report line | +| * 🔍 ⬈ | including\_upload\_delivery\_id| bigint | Foreign key | + + +##### Indexes +|Type |Name |On | +|---|---|---| +| 🔑 | dss\_upload\_line\_pk | ON upload\_line\_id| +| 🔍 | dss\_upload\_line\_uk | ON including\_upload\_delivery\_id, source\_organization\_cd, source\_record\_no| +| 🔎 | dss\_upload\_line\_i1 | ON is\_processed, including\_upload\_delivery\_id| + +##### Foreign Keys +|Type |Name |On | +|---|---|---| +| | dss_upload_line_fk_included_in | ( including\_upload\_delivery\_id ) ref [dss.dss\_upload\_delivery](#dss\_upload\_delivery) (upload\_delivery\_id) | + + + + +### Table dss.dss_user_identity +An externally defined domain directory object representing a potential application user or group + +|Idx |Name |Data Type |Description | +|---|---|---|---| +| * 🔑 ⬋ | user\_identity\_id| bigint GENERATED ALWAYS AS IDENTITY | Unique generated key | +| * | user\_guid| uuid | An immutable unique identifier assigned by the identity provider | +| * | display\_nm| varchar(250) | A human-readable full name that is assigned by the identity provider (this may include a preferred name and/or business unit name) | +| * | identity\_provider\_nm| varchar(25) | A directory or domain that authenticates system users to allow access to the application or its API (e.g. idir, bceidbusiness) | +| * | is\_enabled| boolean | Indicates whether access is currently permitted using this identity | +| * ⬈ | access\_request\_status\_cd| varchar(25) | The current status of the most recent access request made by the user (restricted to Requested, Approved, or Denied) | +| | access\_request\_dtm| timestamptz | A timestamp indicating when the most recent access request was made by the user | +| | access\_request\_justification\_txt| varchar(250) | The most recent user-provided reason for requesting application access | +| | given\_nm| varchar(25) | A name given to a person so that they can easily be identified among their family members (in some cultures, this is often the first name) | +| | family\_nm| varchar(25) | A name that is often shared amongst members of the same family (commonly known as a surname within some cultures) | +| | email\_address\_dsc| varchar(320) | E-mail address associated with the user by the identity provider | +| | business\_nm| varchar(250) | A human-readable organization name that is associated with the user by the identity provider | +| | terms\_acceptance\_dtm| timestamptz | A timestamp indicating when the user most recently accepted the published Terms and Conditions of application access | +| ⬈ | represented\_by\_organization\_id| bigint | Foreign key | +| * | upd\_dtm| timestamptz | Trigger-updated timestamp of last change | +| | upd\_user\_guid| uuid | The globally unique identifier (assigned by the identity provider) for the most recent user to record a change | + + +##### Indexes +|Type |Name |On | +|---|---|---| +| 🔑 | dss\_user\_identity\_pk | ON user\_identity\_id| + +##### Foreign Keys +|Type |Name |On | +|---|---|---| +| | dss_user_identity_fk_representing | ( represented\_by\_organization\_id ) ref [dss.dss\_organization](#dss\_organization) (organization\_id) | +| | dss_user_identity_fk_given | ( access\_request\_status\_cd ) ref [dss.dss\_access\_request\_status](#dss\_access\_request\_status) (access\_request\_status\_cd) | + + +##### Triggers +|Name |Definition | +|---|---| +### Trigger dss_user_identity_br_iu_tr + + ``` +CREATE TRIGGER dss\_user\_identity\_br\_iu\_tr BEFORE INSERT OR UPDATE ON dss.dss\_user\_identity FOR EACH ROW EXECUTE FUNCTION dss.dss\_update\_audit\_columns() +``` + + +### Table dss.dss_user_privilege +A granular access right or privilege within the application that may be granted to a role + +|Idx |Name |Data Type |Description | +|---|---|---|---| +| * 🔑 ⬋ | user\_privilege\_cd| varchar(25) | The immutable system code that identifies the privilege | +| * | user\_privilege\_nm| varchar(250) | The human-readable name that is given for the role | + + +##### Indexes +|Type |Name |On | +|---|---|---| +| 🔑 | dss\_user\_privilege\_pk | ON user\_privilege\_cd| + + + +### Table dss.dss_user_role +A set of access rights and privileges within the application that may be granted to users + +|Idx |Name |Data Type |Description | +|---|---|---|---| +| * 🔑 ⬋ | user\_role\_cd| varchar(25) | The immutable system code that identifies the role | +| * | user\_role\_nm| varchar(250) | The human-readable name that is given for the role | +| | user\_role\_dsc| varchar(200) | The human-readable description that is given for the role | +| | upd\_dtm| timestamptz | Trigger-updated timestamp of last change | +| | upd\_user\_guid| uuid | The globally unique identifier (assigned by the identity provider) for the most recent user to record a change | + + +##### Indexes +|Type |Name |On | +|---|---|---| +| 🔑 | dss\_user\_role\_pk | ON user\_role\_cd| + +##### Triggers +|Name |Definition | +|---|---| +### Trigger dss_user_role_br_iu_tr + + ``` +CREATE TRIGGER dss\_user\_role\_br\_iu\_tr BEFORE INSERT OR UPDATE ON dss.dss\_user\_role FOR EACH ROW EXECUTE FUNCTION dss.dss\_update\_audit\_columns() +``` + + +### Table dss.dss_user_role_assignment +The association of a grantee credential to a role for the purpose of conveying application privileges + +|Idx |Name |Data Type |Description | +|---|---|---|---| +| * 🔑 ⬈ | user\_identity\_id| bigint | Foreign key | +| * 🔑 ⬈ | user\_role\_cd| varchar(25) | Foreign key | +| | upd\_dtm| timestamptz | Trigger-updated timestamp of last change | +| | upd\_user\_guid| uuid | The globally unique identifier (assigned by the identity provider) for the most recent user to record a change | + + +##### Indexes +|Type |Name |On | +|---|---|---| +| 🔑 | dss\_user\_role\_assignment\_pk | ON user\_identity\_id, user\_role\_cd| + +##### Foreign Keys +|Type |Name |On | +|---|---|---| +| | dss_user_role_assignment_fk_granted | ( user\_role\_cd ) ref [dss.dss\_user\_role](#dss\_user\_role) (user\_role\_cd) | +| | dss_user_role_assignment_fk_granted_to | ( user\_identity\_id ) ref [dss.dss\_user\_identity](#dss\_user\_identity) (user\_identity\_id) | + + +##### Triggers +|Name |Definition | +|---|---| +### Trigger dss_user_role_assignment_br_iu_tr + + ``` +CREATE TRIGGER dss\_user\_role\_assignment\_br\_iu\_tr BEFORE INSERT OR UPDATE ON dss.dss\_user\_role\_assignment FOR EACH ROW EXECUTE FUNCTION dss.dss\_update\_audit\_columns() +``` + + +### Table dss.dss_user_role_privilege +The association of a granular application privilege to a role + +|Idx |Name |Data Type |Description | +|---|---|---|---| +| * 🔑 ⬈ | user\_privilege\_cd| varchar(25) | Foreign key | +| * 🔑 ⬈ | user\_role\_cd| varchar(25) | Foreign key | +| | upd\_dtm| timestamptz | Trigger-updated timestamp of last change | +| | upd\_user\_guid| uuid | The globally unique identifier (assigned by the identity provider) for the most recent user to record a change | + + +##### Indexes +|Type |Name |On | +|---|---|---| +| 🔑 | dss\_user\_role\_privilege\_pk | ON user\_privilege\_cd, user\_role\_cd| + +##### Foreign Keys +|Type |Name |On | +|---|---|---| +| | dss_user_role_privilege_fk_conferred_by | ( user\_role\_cd ) ref [dss.dss\_user\_role](#dss\_user\_role) (user\_role\_cd) | +| | dss_user_role_privilege_fk_conferring | ( user\_privilege\_cd ) ref [dss.dss\_user\_privilege](#dss\_user\_privilege) (user\_privilege\_cd) | + + +##### Triggers +|Name |Definition | +|---|---| +### Trigger dss_user_role_privilege_br_iu_tr + + ``` +CREATE TRIGGER dss\_user\_role\_privilege\_br\_iu\_tr BEFORE INSERT OR UPDATE ON dss.dss\_user\_role\_privilege FOR EACH ROW EXECUTE FUNCTION dss.dss\_update\_audit\_columns() +``` + +## Schema dss +### Functions +dss\_containing\_organization\_id +``` + +``` +dss\_update\_audit\_columns +``` + +``` +### Procedures +dss\_process\_biz\_lic\_table\_delete +``` + +``` +dss\_process\_biz\_lic\_table\_insert +``` + +``` +dss\_process\_biz\_lic\_table\_update +``` + +``` + + + + diff --git a/database/model/STR_DSS_Physical_DB_Design_Sprint_14.pdf b/database/model/STR_DSS_Physical_DB_Design_Sprint_14.pdf new file mode 100644 index 00000000..f8187cda Binary files /dev/null and b/database/model/STR_DSS_Physical_DB_Design_Sprint_14.pdf differ diff --git a/database/utility/Correct_Rental_Listings_Sprint_14.sql b/database/utility/Correct_Rental_Listings_Sprint_14.sql new file mode 100644 index 00000000..d1de232c --- /dev/null +++ b/database/utility/Correct_Rental_Listings_Sprint_14.sql @@ -0,0 +1,29 @@ +-- Populate lg_transfer_dtm if null when is_lg_transferred is true +UPDATE dss_rental_listing +SET lg_transfer_dtm = upd_dtm +WHERE including_rental_listing_report_id IS NULL AND lg_transfer_dtm IS NULL AND is_lg_transferred = true; + +-- Correct 12-month nights stayed and separate reservations if differing match found +MERGE INTO dss_rental_listing AS tgt +USING ( + SELECT + drl1.rental_listing_id, + SUM(drl3.nights_booked_qty) AS nights_booked_qty, + SUM(drl3.separate_reservations_qty) AS separate_reservations_qty + FROM dss_rental_listing drl1 + JOIN dss_rental_listing drl2 ON drl2.rental_listing_id = drl1.derived_from_rental_listing_id + JOIN dss_rental_listing drl3 ON drl2.platform_listing_no = drl3.platform_listing_no AND drl2.offering_organization_id = drl3.offering_organization_id + JOIN dss_rental_listing_report drlr2 ON drlr2.rental_listing_report_id = drl2.including_rental_listing_report_id + JOIN dss_rental_listing_report drlr3 ON drlr3.rental_listing_report_id = drl3.including_rental_listing_report_id + WHERE drl1.including_rental_listing_report_id IS NULL + AND drlr2.report_period_ym < drlr3.report_period_ym + interval '12 months' + GROUP BY drl1.rental_listing_id + HAVING MIN(drl1.nights_booked_qty) != SUM(drl3.nights_booked_qty) + OR MIN(drl1.separate_reservations_qty) != SUM(drl3.separate_reservations_qty) +) AS src +ON (tgt.rental_listing_id = src.rental_listing_id) +WHEN MATCHED +THEN + UPDATE SET + nights_booked_qty = src.nights_booked_qty, + separate_reservations_qty = src.separate_reservations_qty; diff --git a/database/utility/STR_DSS_Migration_Sprint_14.sql b/database/utility/STR_DSS_Migration_Sprint_14.sql new file mode 100644 index 00000000..1acf05bb --- /dev/null +++ b/database/utility/STR_DSS_Migration_Sprint_14.sql @@ -0,0 +1,60 @@ +/* SORRY -- UNFINISHED!! Sprint 14 Master Database Migration Script -- must be run from psql using the following command: \i '/