Export JSON/XML/YAML/CSV/MYSQL/PSQL/SQLITE/SQLSERVER/MONGODB #251
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Export All Database Formats | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- 'sql/**' | |
- 'bin/Commands/Export/**' | |
- '.github/workflows/export.yml' | |
workflow_dispatch: | |
inputs: | |
pass: | |
description: "Passcode" | |
required: true | |
env: | |
MYSQL_ROOT_PASSWORD: root | |
POSTGRES_PASSWORD: postgres | |
MONGODB_VERSION: '6.0' | |
jobs: | |
setup-and-export-json: | |
name: Setup Database & Export JSON | |
runs-on: ubuntu-24.04 | |
outputs: | |
region_count: ${{ steps.counts.outputs.region_count }} | |
subregion_count: ${{ steps.counts.outputs.subregion_count }} | |
country_count: ${{ steps.counts.outputs.country_count }} | |
state_count: ${{ steps.counts.outputs.state_count }} | |
city_count: ${{ steps.counts.outputs.city_count }} | |
current_date: ${{ steps.counts.outputs.current_date }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
ref: ${{ github.head_ref }} | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
extensions: intl, pdo_mysql | |
coverage: none | |
ini-values: "post_max_size=256M, memory_limit=512M" | |
- name: Cache Composer dependencies | |
uses: actions/cache@v4 | |
with: | |
path: bin/vendor | |
key: ${{ runner.os }}-composer-${{ hashFiles('bin/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Start MySQL service | |
run: | | |
sudo systemctl start mysql.service | |
mysql --version | |
while ! mysqladmin ping -h"127.0.0.1" --silent; do | |
echo "Waiting for MySQL..." | |
sleep 1 | |
done | |
- name: Setup MySQL Database | |
run: | | |
mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS world CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" | |
mysql -uroot -proot -e "SHOW DATABASES;" | |
echo "Importing SQL file..." | |
if ! mysql -uroot -proot --default-character-set=utf8mb4 world < sql/world.sql; then | |
echo "β SQL import failed" | |
exit 1 | |
fi | |
echo "β SQL import successful" | |
- name: Install Composer Dependencies | |
working-directory: ./bin | |
run: | | |
composer install --no-dev --optimize-autoloader | |
php console list | |
- name: Get Data Counts | |
id: counts | |
run: | | |
region_count=$(mysql -uroot -proot -e 'SELECT COUNT(*) FROM world.regions;' -s) | |
subregion_count=$(mysql -uroot -proot -e 'SELECT COUNT(*) FROM world.subregions;' -s) | |
country_count=$(mysql -uroot -proot -e 'SELECT COUNT(*) FROM world.countries;' -s) | |
state_count=$(mysql -uroot -proot -e 'SELECT COUNT(*) FROM world.states;' -s) | |
city_count=$(mysql -uroot -proot -e 'SELECT COUNT(*) FROM world.cities;' -s) | |
current_date=$(date +'%dth %b %Y') | |
echo "π Data counts:" | |
echo " Regions: $region_count" | |
echo " Subregions: $subregion_count" | |
echo " Countries: $country_count" | |
echo " States: $state_count" | |
echo " Cities: $city_count" | |
echo "region_count=$region_count" >> $GITHUB_OUTPUT | |
echo "subregion_count=$subregion_count" >> $GITHUB_OUTPUT | |
echo "country_count=$country_count" >> $GITHUB_OUTPUT | |
echo "state_count=$state_count" >> $GITHUB_OUTPUT | |
echo "city_count=$city_count" >> $GITHUB_OUTPUT | |
echo "current_date=$current_date" >> $GITHUB_OUTPUT | |
- name: Export JSON (Base Format) | |
working-directory: ./bin | |
run: | | |
echo "π Exporting JSON (base format for other exports)..." | |
php console export:json | |
echo "β JSON export completed" | |
- name: Verify JSON Export | |
run: | | |
echo "π Verifying JSON exports..." | |
ls -la json/ | |
echo "JSON files created: $(find json/ -name "*.json" | wc -l)" | |
# Verify key files exist | |
required_files=("regions.json" "subregions.json" "countries.json" "states.json" "cities.json") | |
for file in "${required_files[@]}"; do | |
if [ ! -f "json/$file" ]; then | |
echo "β Missing required file: json/$file" | |
exit 1 | |
fi | |
echo "β Found: json/$file" | |
done | |
- name: Upload JSON Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: json-exports | |
path: json/ | |
retention-days: 1 | |
export-derived-formats: | |
name: Export XML, YAML & CSV (from JSON) | |
runs-on: ubuntu-24.04 | |
needs: setup-and-export-json | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
extensions: intl, pdo_mysql | |
coverage: none | |
ini-values: "post_max_size=256M, memory_limit=512M" | |
- name: Cache Composer dependencies | |
uses: actions/cache@v4 | |
with: | |
path: bin/vendor | |
key: ${{ runner.os }}-composer-${{ hashFiles('bin/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Download JSON Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: json-exports | |
path: json/ | |
- name: Install Composer Dependencies | |
working-directory: ./bin | |
run: composer install --no-dev --optimize-autoloader | |
- name: Verify JSON Files Present | |
run: | | |
echo "π Verifying JSON files are available..." | |
ls -la json/ | |
if [ $(find json/ -name "*.json" | wc -l) -lt 5 ]; then | |
echo "β Insufficient JSON files for conversion" | |
exit 1 | |
fi | |
echo "β JSON files verified" | |
- name: Export XML (from JSON) | |
working-directory: ./bin | |
run: | | |
echo "π Exporting XML from JSON..." | |
php console export:xml | |
echo "β XML export completed" | |
- name: Export YAML (from JSON) | |
working-directory: ./bin | |
run: | | |
echo "π Exporting YAML from JSON..." | |
php console export:yaml | |
echo "β YAML export completed" | |
- name: Export CSV (from JSON) | |
working-directory: ./bin | |
run: | | |
echo "π Exporting CSV from JSON..." | |
php console export:csv | |
echo "β CSV export completed" | |
- name: Verify Derived Exports | |
run: | | |
echo "π Verifying derived format exports..." | |
echo "XML files: $(find xml/ -name "*.xml" 2>/dev/null | wc -l)" | |
echo "YAML files: $(find yml/ -name "*.yml" 2>/dev/null | wc -l)" | |
echo "CSV files: $(find csv/ -name "*.csv" 2>/dev/null | wc -l)" | |
- name: Upload Derived Format Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: derived-formats | |
path: | | |
xml/ | |
yml/ | |
csv/ | |
retention-days: 1 | |
export-sql-dumps: | |
name: Export MySQL & PostgreSQL Dumps | |
runs-on: ubuntu-24.04 | |
needs: setup-and-export-json | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Cache Node.js dependencies | |
uses: actions/cache@v4 | |
with: | |
path: nmig/node_modules | |
key: ${{ runner.os }}-node-${{ hashFiles('nmig/package-lock.json') }} | |
restore-keys: ${{ runner.os }}-node- | |
- name: Setup Databases | |
run: | | |
# MySQL | |
sudo systemctl start mysql.service | |
while ! mysqladmin ping -h"127.0.0.1" --silent; do sleep 1; done | |
mysql -uroot -proot -e "CREATE DATABASE world CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" | |
mysql -uroot -proot --default-character-set=utf8mb4 world < sql/world.sql | |
# PostgreSQL | |
sudo systemctl start postgresql.service | |
while ! pg_isready; do sleep 1; done | |
sudo -u postgres psql -c "CREATE DATABASE world;" | |
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';" | |
- name: Export MySQL Dumps | |
run: | | |
echo "π Exporting MySQL dumps..." | |
mkdir -p sql | |
mysqldump -uroot -proot --single-transaction --routines --triggers \ | |
--add-drop-table --disable-keys --set-charset --skip-add-locks \ | |
world regions > sql/regions.sql | |
mysqldump -uroot -proot --single-transaction --routines --triggers \ | |
--add-drop-table --disable-keys --set-charset --skip-add-locks \ | |
world subregions > sql/subregions.sql | |
mysqldump -uroot -proot --single-transaction --routines --triggers \ | |
--add-drop-table --disable-keys --set-charset --skip-add-locks \ | |
world countries > sql/countries.sql | |
mysqldump -uroot -proot --single-transaction --routines --triggers \ | |
--add-drop-table --disable-keys --set-charset --skip-add-locks \ | |
world states > sql/states.sql | |
mysqldump -uroot -proot --single-transaction --routines --triggers \ | |
--add-drop-table --disable-keys --set-charset --skip-add-locks \ | |
world cities > sql/cities.sql | |
echo "β MySQL dumps completed" | |
- name: Setup PostgreSQL Migration | |
run: | | |
echo "π Setting up PostgreSQL migration..." | |
if [ ! -f "nmig/package.json" ]; then | |
echo "β NMIG package.json not found" | |
exit 1 | |
fi | |
cp nmig.config.json nmig/config/config.json | |
cd nmig | |
if ! npm ci --silent; then | |
echo "β οΈ npm ci failed, trying npm install..." | |
rm -rf node_modules package-lock.json | |
npm install | |
fi | |
npm run build | |
if ! npm start; then | |
echo "β NMIG migration failed" | |
exit 1 | |
fi | |
cd .. | |
- name: Export PostgreSQL Dumps | |
run: | | |
echo "π Exporting PostgreSQL dumps..." | |
mkdir -p psql | |
export PGPASSWORD=postgres | |
if ! pg_isready -h localhost -p 5432; then | |
echo "β PostgreSQL not ready" | |
exit 1 | |
fi | |
pg_dump --dbname=postgresql://postgres:postgres@localhost/world \ | |
-Fp --inserts --clean --if-exists -t regions > psql/regions.sql | |
pg_dump --dbname=postgresql://postgres:postgres@localhost/world \ | |
-Fp --inserts --clean --if-exists -t subregions > psql/subregions.sql | |
pg_dump --dbname=postgresql://postgres:postgres@localhost/world \ | |
-Fp --inserts --clean --if-exists -t countries > psql/countries.sql | |
pg_dump --dbname=postgresql://postgres:postgres@localhost/world \ | |
-Fp --inserts --clean --if-exists -t states > psql/states.sql | |
pg_dump --dbname=postgresql://postgres:postgres@localhost/world \ | |
-Fp --inserts --clean --if-exists -t cities > psql/cities.sql | |
pg_dump --dbname=postgresql://postgres:postgres@localhost/world \ | |
-Fp --inserts --clean --if-exists > psql/world.sql | |
echo "β PostgreSQL dumps completed" | |
- name: Verify SQL Dumps | |
run: | | |
echo "π Verifying SQL dumps..." | |
echo "MySQL dumps: $(find sql/ -name "*.sql" | wc -l)" | |
echo "PostgreSQL dumps: $(find psql/ -name "*.sql" | wc -l)" | |
- name: Upload SQL Dump Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sql-dumps | |
path: | | |
sql/ | |
psql/ | |
retention-days: 1 | |
export-sqlite: | |
name: Export SQLite Databases | |
runs-on: ubuntu-24.04 | |
needs: setup-and-export-json | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup MySQL | |
run: | | |
sudo systemctl start mysql.service | |
while ! mysqladmin ping -h"127.0.0.1" --silent; do sleep 1; done | |
mysql -uroot -proot -e "CREATE DATABASE world CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" | |
mysql -uroot -proot --default-character-set=utf8mb4 world < sql/world.sql | |
- name: Install Python Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install mysql-to-sqlite3 | |
mysql2sqlite --version | |
- name: Export SQLite Databases | |
run: | | |
echo "π Exporting SQLite databases..." | |
# Clean up any existing SQLite files first | |
echo "π§Ή Cleaning up existing SQLite files..." | |
rm -rf sqlite/ | |
mkdir -p sqlite | |
# Check MySQL table structures | |
echo "π Checking table structures..." | |
mysql -uroot -proot -e "DESCRIBE world.states;" | |
export_table() { | |
local table=$1 | |
echo "Exporting $table..." | |
table_exists=$(mysql -uroot -proot -e "SELECT COUNT(*) FROM information_schema.tables WHERE table_schema='world' AND table_name='$table';" -s) | |
if [ "$table_exists" -eq 0 ]; then | |
echo "β οΈ Table $table does not exist, skipping..." | |
return 0 | |
fi | |
mysql -uroot -proot -e "SELECT COUNT(*) FROM world.$table;" -s | |
if mysql2sqlite -d world -t "$table" --mysql-password root -u root -f "sqlite/${table}.sqlite3"; then | |
echo "β $table exported successfully" | |
sqlite3 "sqlite/${table}.sqlite3" ".tables" | |
else | |
echo "β Failed to export $table" | |
mysql -uroot -proot -e "SHOW CREATE TABLE world.$table\G" | |
return 1 | |
fi | |
} | |
export_table "regions" | |
export_table "subregions" | |
export_table "countries" | |
export_table "states" | |
export_table "cities" | |
echo "π Exporting combined database..." | |
mysql2sqlite -d world --mysql-password root -u root -f sqlite/world.sqlite3 | |
echo "β SQLite export completed" | |
- name: Verify SQLite Exports | |
run: | | |
echo "π Verifying SQLite exports..." | |
echo "SQLite files: $(find sqlite/ -name "*.sqlite3" | wc -l)" | |
for file in sqlite/*.sqlite3; do | |
if [ -f "$file" ]; then | |
echo "File: $(basename $file)" | |
echo "Tables: $(sqlite3 "$file" ".tables" | wc -w)" | |
fi | |
done | |
- name: Upload SQLite Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sqlite-exports | |
path: sqlite/ | |
retention-days: 1 | |
export-specialized-formats: | |
name: Export SQL Server & MongoDB | |
runs-on: ubuntu-24.04 | |
needs: setup-and-export-json | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
extensions: intl, pdo_mysql | |
coverage: none | |
ini-values: "post_max_size=256M, memory_limit=512M" | |
- name: Setup MySQL | |
run: | | |
sudo systemctl start mysql.service | |
while ! mysqladmin ping -h"127.0.0.1" --silent; do sleep 1; done | |
mysql -uroot -proot -e "CREATE DATABASE world CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" | |
mysql -uroot -proot --default-character-set=utf8mb4 world < sql/world.sql | |
- name: Setup MongoDB | |
uses: supercharge/mongodb-github-action@1.10.0 | |
with: | |
mongodb-version: ${{ env.MONGODB_VERSION }} | |
mongodb-replica-set: rs0 | |
- name: Install MongoDB Tools | |
run: | | |
wget -q https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2204-x86_64-100.7.3.deb | |
sudo dpkg -i mongodb-database-tools-ubuntu2204-x86_64-100.7.3.deb | |
rm mongodb-database-tools-ubuntu2204-x86_64-100.7.3.deb | |
mongoimport --version | |
- name: Cache Composer dependencies | |
uses: actions/cache@v4 | |
with: | |
path: bin/vendor | |
key: ${{ runner.os }}-composer-${{ hashFiles('bin/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Install Composer Dependencies | |
working-directory: ./bin | |
run: composer install --no-dev --optimize-autoloader | |
- name: Export SQL Server | |
working-directory: ./bin | |
run: | | |
echo "π Exporting SQL Server..." | |
php console export:sql-server | |
echo "β SQL Server export completed" | |
- name: Export MongoDB | |
working-directory: ./bin | |
run: | | |
echo "π Exporting MongoDB..." | |
php console export:mongodb | |
echo "β MongoDB export completed" | |
- name: Setup MongoDB Import | |
working-directory: ./mongodb | |
run: | | |
echo "π Setting up MongoDB import..." | |
sleep 5 | |
import_collection() { | |
local collection=$1 | |
echo "Importing $collection..." | |
if ! mongoimport --host localhost:27017 --db world \ | |
--collection "$collection" --file "${collection}.json" --jsonArray; then | |
echo "β Failed to import $collection" | |
return 1 | |
fi | |
echo "β $collection imported successfully" | |
} | |
import_collection "regions" | |
import_collection "subregions" | |
import_collection "countries" | |
import_collection "states" | |
import_collection "cities" | |
echo "π Creating MongoDB dump..." | |
mongodump --host localhost:27017 --db world --out mongodb-dump | |
tar -czf world-mongodb-dump.tar.gz mongodb-dump | |
rm -rf mongodb-dump *.json | |
echo "β MongoDB export completed" | |
- name: Verify Specialized Exports | |
run: | | |
echo "π Verifying specialized format exports..." | |
echo "SQL Server files: $(find sqlserver/ -name "*.sql" 2>/dev/null | wc -l)" | |
echo "MongoDB files: $(find mongodb/ -name "*.tar.gz" 2>/dev/null | wc -l)" | |
- name: Upload Specialized Format Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: specialized-formats | |
path: | | |
sqlserver/ | |
mongodb/ | |
retention-days: 1 | |
finalize: | |
name: Update Documentation & Create PR | |
runs-on: ubuntu-24.04 | |
needs: [setup-and-export-json, export-derived-formats, export-sql-dumps, export-sqlite, export-specialized-formats] | |
if: needs.setup-and-export-json.result == 'success' && needs.export-derived-formats.result == 'success' && needs.export-sql-dumps.result == 'success' && needs.export-sqlite.result == 'success' && needs.export-specialized-formats.result == 'success' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download All Export Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: exports/ | |
- name: Merge All Export Artifacts | |
run: | | |
echo "π Merging all export artifacts..." | |
# Copy JSON exports | |
if [ -d "exports/json-exports" ]; then | |
cp -r exports/json-exports/* . | |
echo "β JSON exports merged" | |
fi | |
# Copy derived formats | |
if [ -d "exports/derived-formats" ]; then | |
cp -r exports/derived-formats/* . | |
echo "β Derived formats merged" | |
fi | |
# Copy SQL dumps | |
if [ -d "exports/sql-dumps" ]; then | |
cp -r exports/sql-dumps/* . | |
echo "β SQL dumps merged" | |
fi | |
# Copy SQLite exports | |
if [ -d "exports/sqlite-exports" ]; then | |
cp -r exports/sqlite-exports/* . | |
echo "β SQLite exports merged" | |
fi | |
# Copy specialized formats | |
if [ -d "exports/specialized-formats" ]; then | |
cp -r exports/specialized-formats/* . | |
echo "β Specialized formats merged" | |
fi | |
rm -rf exports/ | |
# Verify all exports are present | |
echo "π Final export verification:" | |
echo " JSON files: $(find . -name "*.json" 2>/dev/null | wc -l)" | |
echo " XML files: $(find . -name "*.xml" 2>/dev/null | wc -l)" | |
echo " YAML files: $(find . -name "*.yml" 2>/dev/null | wc -l)" | |
echo " CSV files: $(find . -name "*.csv" 2>/dev/null | wc -l)" | |
echo " SQL files: $(find . -name "*.sql" 2>/dev/null | wc -l)" | |
echo " SQLite files: $(find . -name "*.sqlite3" 2>/dev/null | wc -l)" | |
- name: Update README.md | |
run: | | |
echo "π Updating README.md..." | |
sed -i "s/Total Regions : [0-9]* <br>/Total Regions : ${{ needs.setup-and-export-json.outputs.region_count }} <br>/" README.md | |
sed -i "s/Total Sub Regions : [0-9]* <br>/Total Sub Regions : ${{ needs.setup-and-export-json.outputs.subregion_count }} <br>/" README.md | |
sed -i "s/Total Countries : [0-9]* <br>/Total Countries : ${{ needs.setup-and-export-json.outputs.country_count }} <br>/" README.md | |
sed -i "s/Total States\/Regions\/Municipalities : [0-9]* <br>/Total States\/Regions\/Municipalities : ${{ needs.setup-and-export-json.outputs.state_count }} <br>/" README.md | |
sed -i "s/Total Cities\/Towns\/Districts : [0-9]* <br>/Total Cities\/Towns\/Districts : ${{ needs.setup-and-export-json.outputs.city_count }} <br>/" README.md | |
sed -i "s/Last Updated On : .*$/Last Updated On : ${{ needs.setup-and-export-json.outputs.current_date }}/" README.md | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
commit-message: | | |
π¦ Complete Database Export - ${{ needs.setup-and-export-json.outputs.current_date }} | |
β All export formats completed successfully: | |
- JSON: Base structured data (9 files) | |
- XML: Markup format derived from JSON (9 files) | |
- YAML: Human-readable format derived from JSON (9 files) | |
- CSV: Spreadsheet format derived from JSON (5 files) | |
- MySQL: Database dumps from source DB (5 files) | |
- PostgreSQL: Migrated and exported (6 files) | |
- SQLite: Portable databases from source DB (6 files) | |
- SQL Server: T-SQL scripts from source DB | |
- MongoDB: Collections and dump from source DB | |
π Total records: ${{ needs.setup-and-export-json.outputs.country_count }} countries, ${{ needs.setup-and-export-json.outputs.state_count }} states, ${{ needs.setup-and-export-json.outputs.city_count }} cities | |
committer: Darshan Gada <gadadarshan@gmail.com> | |
author: GitHub Actions <actions@github.com> | |
signoff: true | |
branch: export/complete-${{ github.run_number }} | |
delete-branch: true | |
title: "π Complete Database Export - ${{ needs.setup-and-export-json.outputs.current_date }}" | |
body: | | |
## π¦ Complete Database Export Success | |
All export formats have been successfully generated with proper dependencies. | |
### π Data Statistics | |
- **π Regions**: ${{ needs.setup-and-export-json.outputs.region_count }} | |
- **πΊοΈ Subregions**: ${{ needs.setup-and-export-json.outputs.subregion_count }} | |
- **π³οΈ Countries**: ${{ needs.setup-and-export-json.outputs.country_count }} | |
- **ποΈ States/Provinces**: ${{ needs.setup-and-export-json.outputs.state_count }} | |
- **ποΈ Cities**: ${{ needs.setup-and-export-json.outputs.city_count }} | |
### π Export Workflow & Dependencies | |
#### 1οΈβ£ Base Export (JSON from MySQL) | |
- β **JSON** - Generated directly from MySQL database | |
#### 2οΈβ£ Derived Formats (from JSON) | |
- β **XML** - Converted from JSON exports | |
- β **YAML** - Converted from JSON exports | |
- β **CSV** - Converted from JSON exports | |
#### 3οΈβ£ Database Formats (from MySQL) | |
- β **MySQL Dumps** - Direct exports from source database | |
- β **PostgreSQL Dumps** - Migrated from MySQL then exported | |
- β **SQLite Files** - Converted from MySQL database | |
- β **SQL Server Scripts** - Generated from MySQL database | |
- β **MongoDB Collections** - Exported from MySQL, imported to MongoDB, then dumped | |
### π Generated Files | |
#### JSON Format (Base - 9 files) | |
- Individual: `regions.json`, `subregions.json`, `countries.json`, `states.json`, `cities.json` | |
- Combined: `countries+states.json`, `countries+cities.json`, `states+cities.json`, `countries+states+cities.json` | |
#### Derived Formats (from JSON) | |
- **XML**: 9 files (same structure as JSON) | |
- **YAML**: 9 files (same structure as JSON) | |
- **CSV**: 5 files (individual tables only) | |
#### Database Formats (from MySQL) | |
- **MySQL**: 5 individual table dumps | |
- **PostgreSQL**: 5 individual + 1 complete dump (6 files) | |
- **SQLite**: 5 individual + 1 combined database (6 files) | |
- **SQL Server**: T-SQL compatible scripts | |
- **MongoDB**: JSON collections + compressed dump archive | |
### β‘ Workflow Improvements | |
- **π Proper Dependencies**: Each export step depends on required inputs | |
- **π Sequential Execution**: Ensures all dependencies are met | |
- **β Complete Validation**: All formats verified before PR creation | |
- **π Artifact Chain**: Exports passed between jobs as artifacts | |
- **π‘οΈ Error Handling**: Workflow stops if any critical step fails | |
### π― Quality Assurance | |
- All JSON files validated before derived format conversion | |
- Database connections verified before exports | |
- File counts validated for each format | |
- Export integrity checked post-generation | |
- Complete artifact chain preserved in PR | |
--- | |
**π€ Generated by Sequential Export Workflow** | |
**π Export Date**: ${{ needs.setup-and-export-json.outputs.current_date }} | |
**π Workflow Run**: #${{ github.run_number }} | |
**β All Dependencies**: JSON β XML/YAML/CSV, MySQL β All DB formats | |
labels: | | |
exports | |
automated | |
data-update | |
β complete | |
π sequential | |
reviewers: dr5hn | |
draft: false |