Closed LamNz79 closed 2 months ago
I've improved the error message in #226 to give you some solutions to the issue of git converting the line endings in your files:
throw new Error(
`Invalid migration '${fullPath}': it looks like the line endings have been corrupted - perhaps you have configured git to replace LF with CRLF? Here's a couple potential solutions:
Option 1: Add \`path/to/migrations/committed/*.sql -text\` to \`.gitattributes\` in your repository
Option 2: Globally reconfigure git to convert CRLF to LF on commit, but never convert LF back to CRLF: \`git config --global core.autocrlf input\`
`,
);
I encountered an issue after pulling the committed SQL migration files from the repository. My friend pushed all of the SQL files, and when I tried to run the server using PostGraphile, the following error occurred during migration:
Error: Invalid migration './migrations/committed/000001.sql': there should be two newlines after the headers section
Steps to Reproduce:
npm start
npm run migrate migrate
What I Tried:
Question: How can I resolve this error with the migration file? Is there a specific way the SQL files should be structured that I am missing? Any guidance would be appreciated!