You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Fix PostgreSQL migration 014 CREATE FUNCTION syntax error
This release fixes a critical bug in PostgreSQL migration 014 that was
causing "syntax error at or near 'RETURNS'" errors in production.
## Root Cause
The sqlparser library was dropping empty parentheses `()` from CREATE FUNCTION
statements when reformatting parsed SQL. PostgreSQL requires these parentheses
even when functions have no parameters.
## Key Fixes
### Migration Parser Enhancement
- Enhanced `parse_sql_statements` to detect CREATE FUNCTION statements
- Added automatic restoration of missing parentheses before RETURNS clause
- Fixed syntax: `CREATE FUNCTION name()` instead of `CREATE FUNCTION name`
### Enhanced Test Coverage
- Updated `test_migration_014_sql_parsing` to explicitly verify parentheses preservation
- Added assertions to ensure function names include required parentheses
- Validates complete SQL syntax correctness after sqlparser formatting
### Version Update
- Bumped version to 1.15.3
- Updated CHANGELOG.md with detailed fix description
## Impact
- Migration 014 now executes successfully in production environments
- Resolves CREATE FUNCTION syntax errors in PostgreSQL migrations
- Maintains backward compatibility with existing migration behavior
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
0 commit comments