# Migration Changes - 2023-10-10

## 20250217053711-update-users-payments-recents-views.js

- **Update Records**:
  - `users_flags`
  - `users_privacy_flags`
  - `payment_history`
- **Delete Records**:
  - `users_flags`
  - `users_privacy_flags`
  - `payment_history`
- **Constraints**:
  - `users_flags.user_id` - `CASCADE`
  - `users_privacy_flags.user_id` - `CASCADE`
  - `payment_history.customer_id` - `SET NULL`
  - `payment_history.host_id` - `SET NULL`
  - `recently_viewed_listings.user_id` - `CASCADE`
  - `recently_viewed_listings.listing_id` - `CASCADE`

## 20250217052738-update-reviews.js

- **Update Records**:
  - `customer_reviews`
  - `host_reviews`
  - `listing_reviews`
- **Delete Records**:
  - `customer_reviews`
  - `host_reviews`
  - `listing_reviews`
- **Constraints**:
  - `customer_reviews.user_id` - `SET NULL`
  - `customer_reviews.host_id` - `SET NULL`
  - `host_reviews.user_id` - `SET NULL`
  - `host_reviews.host_id` - `SET NULL`
  - `listing_reviews.user_id` - `SET NULL`
  - `listing_reviews.listing_id` - `CASCADE`

## 20250217052336-update-hosts-registrations-notifications.js

- **Delete Records**:
  - `host_registrations`
  - `host_registration_add_ons`
  - `host_registration_files`
- **Constraints**:
  - `host_registrations.user_id` - `CASCADE`
  - `host_notifications.host_id` - `CASCADE`
  - `host_registration_add_ons.host_registration_id` - `CASCADE`
  - `host_registration_files.host_registration_id` - `CASCADE`

## 20250217051956-update-favorites.js

- **Delete Records**:
  - `favorite_folders`
  - `favorite_folder_listings`
- **Constraints**:
  - `favorite_folders.user_id` - `CASCADE`
  - `favorite_folder_listings.user_id` - `CASCADE`
  - `favorite_folder_listings.folder_id` - `CASCADE`

## 20250217051709-update-conversations.js

- **Update Records**:
  - `conversation_members`
  - `messages`
- **Delete Records**:
  - `messages`
- **Constraints**:
  - `conversation_members.user_id` - `SET NULL`
  - `conversation_members.convo_id` - `CASCADE`
  - `messages.convo_id` - `CASCADE`
  - `messages.sender_id` - `SET NULL`
  - `message_attachments.message_id` - `CASCADE`

## 20250217051415-update-bookings.js

- **Update Records**:
  - `bookings`
- **Delete Records**:
  - `bookings`
  - `booking_add_ons`
- **Constraints**:
  - `bookings.customer_id` - `SET NULL`
  - `bookings.host_id` - `SET NULL`
  - `bookings.listing_id` - `SET NULL`
  - `booking_add_ons.booking_id` - `CASCADE`

## 20250217051229-update-listings.js

- **Delete Records**:
  - `listings`
  - `listing_add_ons`
  - `listing_images`
- **Constraints**:
  - `listings.host_id` - `CASCADE`
  - `listing_add_ons.listing_id` - `CASCADE`
  - `listing_images.listing_id` - `CASCADE`
