Message header lost on commit error
See original GitHub issueSummary
When you try to commit a migration which has a --! Message:
header in current.sql
, and that migration fails for some reason, e.g. syntax error, current.sql
is restored, but the --! Message:
is lost.
Steps to reproduce
Have contents of current.sql
as such:
--! Message: test-migration
DROP TABLE IF EXISTS app_public.table_name CASCADE;
CREATE TABLE app_public.table_name(
id TEXT PRIMARY KEY,
title TEXT, --this comma causes an error
);
run the commit
command and get an error like this:
Expected results
Have contents of current.sql
the same as before failure:
--! Message: test-migration
DROP TABLE IF EXISTS app_public.table_name CASCADE;
CREATE TABLE app_public.table_name(
id TEXT PRIMARY KEY,
title TEXT, --this comma causes an error
);
Actual results
Actual contents of current.sql
are missing the header:
DROP TABLE IF EXISTS app_public.table_name CASCADE;
CREATE TABLE app_public.table_name(
id TEXT PRIMARY KEY,
title TEXT, --this comma causes an error
);
Additional context
graphile-migrate version 1.0.2.
Possible Solution
Since there is a log before that like
graphile-migrate[shadow]: Running migration '000002-test-migration.sql'
It should be possible to get the message value at least from filename.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Git repository corrupt (incorrect header check; loose object is ...
It appears that git created files in .git/objects for the new commit, but didn't successfully write to them. I solved it by deleting...
Read more >Can't commit - "Waiting for Emacs... *ERROR*: BUG ... - GitHub
*ERROR*: BUG: missing headers" #3754 ... However now when I try to commit, Emacs waits for a moment and then I get message:...
Read more >Why is orignal message header is lost in Outlook replies?
Recently, original message header is lost when replying or forwarding emails in some Outlook mails. It is strange that some emails retain the...
Read more >[Junos Platform] Commit failure due to missing file or directory
When a file or directory is missing, users receive an error message and command commit fails. This article describes how to rebuild a...
Read more >git-commit Documentation - Git
It is an error for the "amend!" commit's log message to be empty unless --allow-empty-message is specified. --fixup=reword:<commit> is shorthand for --fixup= ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for the heads up! It might also take a while for me to free some time, but it’s not a big inconvenience, so totally fine for it to wait 😃
Sure 👍