Skip to content

Fix schema file formats: Add PostgreSQL schema export and remove SQL Server schema#1332

Merged
dr5hn merged 5 commits intomasterfrom
copilot/remove-mysql-schema-file
Jan 11, 2026
Merged

Fix schema file formats: Add PostgreSQL schema export and remove SQL Server schema#1332
dr5hn merged 5 commits intomasterfrom
copilot/remove-mysql-schema-file

Conversation

Copy link
Contributor

Copilot AI commented Jan 11, 2026

What changed?

Fixed schema file format issues for PostgreSQL and SQL Server exports:

PostgreSQL (psql/schema.sql):

  • Was incorrectly generated using mysqldump (MySQL format)
  • Now properly generated using pg_dump --schema-only (PostgreSQL format)
  • Creates schema-only file with proper PostgreSQL DDL syntax

SQL Server (sqlserver/schema.sql):

  • Was incorrectly generated using mysqldump (MySQL format)
  • Removed as schema is already included in individual table exports
  • Not needed for SQL Server format exports

Changes:

  • Added pg_dump --schema-only command in export workflow for PostgreSQL schema
  • Removed mysqldump line for SQL Server schema generation
  • Deleted sqlserver/schema.sql file (185 lines)
  • Updated .gitignore to track psql/schema.sql and exclude sqlserver/schema.sql
  • Updated fix documentation

Type of Change

  • 🐛 Bug/Data fix
  • ✨ New data (cities/states/countries)
  • 📝 Data update
  • 🔧 Infrastructure/Scripts
  • 📚 Documentation

Affected Locations

N/A - Infrastructure change only

Checklist

  • Edited JSON files in contributions/ directory
  • Omitted id field for new records (auto-assigned)
  • Verified data against reliable sources
  • Tested locally (optional)

Sources

Notes

PostgreSQL schema export now uses pg_dump --schema-only with proper flags:

  • --schema-only: Export only DDL (CREATE statements), no data
  • --clean --if-exists: Include DROP IF EXISTS statements for safe imports
  • --no-owner --no-acl: Exclude ownership and privilege commands

SQL Server schema file removed as it was MySQL-formatted and redundant. Schema definitions are already included in the individual table SQL exports for SQL Server format.

Result:

  • sql/schema.sql - MySQL format (correct, unchanged)
  • psql/schema.sql - PostgreSQL format using pg_dump (now correct)
  • No sqlserver/schema.sql - removed (not needed)
Original prompt

This section details on the original issue you should resolve

<issue_title>[Bug]: psql/schema.sql is actually MySQL</issue_title>
<issue_description>### Issue Type

API/Export Issue

Location (if applicable)

No response

What's wrong?

The file psql/schema.sql contains a dump from MySQL.

What should it be?

A PostgreSQL dump like the other files

Source (optional)

No response</issue_description>

<agent_instructions>I think we don't need this file, Remove any references if it has dependency on any workflow please let me know.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Jan 11, 2026
Copilot AI and others added 3 commits January 11, 2026 07:20
Co-authored-by: dr5hn <6929121+dr5hn@users.noreply.github.com>
Co-authored-by: dr5hn <6929121+dr5hn@users.noreply.github.com>
Co-authored-by: dr5hn <6929121+dr5hn@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove MySQL dump from psql/schema.sql Remove incorrect MySQL-formatted psql/schema.sql Jan 11, 2026
Copilot AI requested a review from dr5hn January 11, 2026 07:25
@dr5hn
Copy link
Owner

dr5hn commented Jan 11, 2026

@copilot Can you please add back psql/schema.sql and add proper schema export command in girhub actions

And remove schema file from sqlserver folder

Co-authored-by: dr5hn <6929121+dr5hn@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 11, 2026

@copilot Can you please add back psql/schema.sql and add proper schema export command in girhub actions

And remove schema file from sqlserver folder

Done! Changes implemented in commit 04210a2:

Added:

  • PostgreSQL schema export using pg_dump --schema-only command
  • Proper PostgreSQL-compatible schema file at psql/schema.sql

Removed:

  • sqlserver/schema.sql file (was MySQL format)
  • MySQL dump command for SQL Server schema generation

The workflow now generates:

  • sql/schema.sql - MySQL format (correct)
  • psql/schema.sql - PostgreSQL format using pg_dump (correct)
  • No sqlserver/schema.sql - schema included in table exports

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 11, 2026
Copilot AI changed the title Remove incorrect MySQL-formatted psql/schema.sql Fix schema file formats: Add PostgreSQL schema export and remove SQL Server schema Jan 11, 2026
@dr5hn dr5hn marked this pull request as ready for review January 11, 2026 19:48
Copilot AI review requested due to automatic review settings January 11, 2026 19:48
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Jan 11, 2026
Copilot AI requested a review from dr5hn January 11, 2026 19:48
@dr5hn dr5hn merged commit 45317db into master Jan 11, 2026
5 checks passed
@dr5hn dr5hn deleted the copilot/remove-mysql-schema-file branch January 11, 2026 19:49
@dosubot dosubot bot added the bug Something isn't working label Jan 11, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a schema file format issue where psql/schema.sql was incorrectly generated using MySQL's mysqldump instead of PostgreSQL format. The fix adds proper PostgreSQL schema export using pg_dump --schema-only and removes the redundant SQL Server schema file.

Changes:

  • Added proper PostgreSQL schema export using pg_dump with correct flags in the GitHub Actions workflow
  • Removed incorrect MySQL-formatted schema generation for PostgreSQL and SQL Server
  • Updated .gitignore to track psql/schema.sql and exclude sqlserver/schema.sql

Reviewed changes

Copilot reviewed 4 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.github/workflows/export.yml Removed incorrect mysqldump commands for psql/sqlserver schemas; added proper pg_dump --schema-only command for PostgreSQL schema export
psql/schema.sql Deleted old MySQL-formatted file (will be regenerated in PostgreSQL format)
sqlserver/schema.sql Deleted MySQL-formatted file (not needed for SQL Server exports)
.gitignore Updated to track psql/schema.sql and exclude sqlserver/schema.sql with clarifying comment
.github/fixes-docs/FIX_SCHEMA_FILES_FORMAT.md Added comprehensive documentation explaining the issue, solution, and validation steps
bin/db/schema.sql Auto-generated timestamp update (acceptable)
contributions/countries/countries.json, contributions/cities/BQ.json Minor formatting change (closing bracket moved to new line)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: psql/schema.sql is actually MySQL

3 participants