Guide to Adding Curaçao Cities in Production
This guide explains how to safely add all Curaçao cities in the production environment.✅ Safety Features
Thecities:add-curacao command is designed to be 100% safe in production:
- ✅ Does not delete data: Only adds cities, never deletes or modifies existing data
- ✅ Idempotent: Can be run multiple times without issues
- ✅ Transactional: Uses database transactions (if an error occurs, everything is rolled back)
- ✅ Checks for duplicates: Verifies whether cities already exist before adding them
- ✅ Dry-run mode: Lets you preview what would be added without making real changes
📋 Prerequisites
-
Make sure the country Curaçao exists in the
countriestable- ISO2 code:
CW - If it doesn’t exist, run the seeder first:
php artisan db:seed --class=CountriesSeeder
- ISO2 code:
-
Back up the database (recommended but not critical, since we are only adding data):
🚀 Deployment Process
Step 1: Dry-Run Mode (Recommended)
First, run the command in dry-run mode to see which cities would be added:- Which country was found
- How many cities already exist
- Which cities would be added
- It will NOT make any changes to the database
Step 2: Run in Production
If the dry-run looks good, run the command without the--dry-run flag:
- Look up the country Curaçao (CW)
- Check which cities already exist
- Show the cities that will be added
- Ask for confirmation before proceeding
- Add only the cities that do not exist
- Show a summary of what was added
Step 3: Verification
Verify that the cities were added correctly:- Go to any checkout form
- Select the country “Curaçao”
- Verify that the cities appear (Willemstad, Bandariba, etc.)
📊 Cities That Are Added
The command adds the following 24 main Curaçao cities:- Willemstad (Capital)
- Bandariba
- Bandabou
- Sint Michiel
- St. Michiel
- Santa Rosa
- Sint Michiel Liber
- Brievengat
- Barber
- Dorp Soto
- Otrabanda
- Sabana Westpunt
- Westpunt
- Lagun
- Tera Kora
- Nieuwpoort
- Playa Kanoa
- Playa Kalki
- Boca San Pedro
- Rincon
- Dorp Sint Willebrordus
- Groot Sint Joris
- Sint Joris
- Klein Sint Joris
🔄 Running Multiple Times
The command is completely safe to run multiple times. If a city already exists, it will simply be skipped and the command will continue with the rest.⚠️ Troubleshooting
Error: “Curaçao (CW) not found in countries table”
Solution: Run the countries seeder first:Database permission error
Solution: Verify that the database user has INSERT permissions on thecities table.
Cities do not appear at checkout
Solution:- Verify that the
/api/get-states?country=CWendpoint returns the cities - Clear the cache if necessary:
php artisan cache:clear - Verify that the JavaScript code is loading the cities correctly
📝 Additional Notes
- The CSV
cities_202505192231.csvhas already been updated with these cities - If you run the full cities seeder (
CitiesSeeder), these cities will also be included - The command uses transactions, so if an error occurs, all changes are automatically rolled back
🔗 Related Files
- Command:
app/Console/Commands/AddWillemstadCity.php - CSV:
cities_202505192231.csv - Model:
app/Models/Cities.php - API Endpoint:
routes/web.php(line 44:/api/get-states)
