dr5hn / countries-states-cities-database

🌍 Discover our global repository of countries, states, and cities! 🏙️ Get comprehensive data in JSON, SQL, PSQL, XML, YAML, and CSV formats. Access ISO2, ISO3 codes, country code, capital, native language, timezones (for countries), and more. #countries #states #cities
https://dr5hn.github.io/countries-states-cities-database/
Open Data Commons Open Database License v1.0
7.28k stars 2.54k forks source link

feat: Add Postgres database migration and export action #739

Closed agostinofiscale closed 8 months ago

agostinofiscale commented 8 months ago

Hi everyone!

I needed the countries-states-cities-database for Supabase that uses Postgres but of course the SQL was not working. So i found out a way to migrate datas from MySQL to Postgres using a third-party software called pgloader.

I thought to make this because of course there will be changes and maybe someone else can use this as well.

I downgraded MySQL to 5.7 because the 8 uses a different authentication system that pgloader doesn't support, it doesn't seems to break something but maybe you will see something that I don't see.

dr5hn commented 8 months ago

@agostinofiscale Awesome 🔥

Is there a way we can test the action before merging it?

agostinofiscale commented 8 months ago

Hi @dr5hn,

I started an action and as you can see it worked well, the only problem was for the pull request because the reviewers are not collaborators in my fork.

Tell me If i can help in some way!

dr5hn commented 8 months ago

@agostinofiscale But i see those psql files empty.

agostinofiscale commented 8 months ago

@dr5hn check out the PR generated in my fork

dr5hn commented 8 months ago

@agostinofiscale Thanks i can see that now! Btw any reason behind using mysql 5.7 instead of 8?

agostinofiscale commented 8 months ago

@dr5hn Yep

I downgraded MySQL to 5.7 because the 8 uses a different authentication system that pgloader doesn't support, it doesn't seems to break something but maybe you will see something that I don't see.

dr5hn commented 8 months ago

@agostinofiscale Once more, I want to express my heartfelt gratitude for your valuable contribution. 🍻