Fix schema file formats: Add PostgreSQL schema export and remove SQL Server schema#1332
Fix schema file formats: Add PostgreSQL schema export and remove SQL Server schema#1332
Conversation
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 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>
Done! Changes implemented in commit 04210a2: Added:
Removed:
The workflow now generates:
|
There was a problem hiding this comment.
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_dumpwith correct flags in the GitHub Actions workflow - Removed incorrect MySQL-formatted schema generation for PostgreSQL and SQL Server
- Updated
.gitignoreto trackpsql/schema.sqland excludesqlserver/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) |
What changed?
Fixed schema file format issues for PostgreSQL and SQL Server exports:
PostgreSQL (
psql/schema.sql):mysqldump(MySQL format)pg_dump --schema-only(PostgreSQL format)SQL Server (
sqlserver/schema.sql):mysqldump(MySQL format)Changes:
pg_dump --schema-onlycommand in export workflow for PostgreSQL schemamysqldumpline for SQL Server schema generationsqlserver/schema.sqlfile (185 lines).gitignoreto trackpsql/schema.sqland excludesqlserver/schema.sqlType of Change
Affected Locations
N/A - Infrastructure change only
Checklist
contributions/directoryidfield for new records (auto-assigned)Sources
Notes
PostgreSQL schema export now uses
pg_dump --schema-onlywith 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 commandsSQL 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)sqlserver/schema.sql- removed (not needed)Original prompt
💡 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.