# Migrations Checklist

Migration order implemented in `database/migrations`:

1. `users` (legacy existing migration)
2. `add_role_status_phone_to_users_table`
3. `host_profiles`
4. `listings`
5. `listing_photos`
6. `amenities`
7. `amenity_listing`
8. `availability_rules`
9. `availability_exceptions`
10. `bookings`
11. `booking_payments`
12. `favorites`
13. `reviews`
14. `vehicles`
15. `password_reset_tokens`
16. `personal_access_tokens`
17. `jobs/job_batches/failed_jobs`
18. `cache/cache_locks/sessions`

## Notes

- `users`/`password_resets` existed in legacy migrations; additive migrations were used instead of destructive replacement.
- `listings.host_user_id` uses `restrictOnDelete()` to preserve history.
- `bookings.listing_id` and `bookings.user_id` use `restrictOnDelete()` for booking history integrity.
- InnoDB engine is enforced via MySQL connection config.
- DB-level overlap constraints are not used; overlap prevention is implemented in action layer with transaction + row locking.

## Seeder Order

1. `AmenitiesSeeder`
2. `UsersSeeder`
3. `HostProfilesSeeder`
4. `ListingsSeeder`
5. `ListingPhotosSeeder`
6. `AvailabilitySeeder`
7. `BookingsSeeder`
8. `ReviewsSeeder`
9. `FavoritesSeeder`
