When migration generates an error not all errors are output in the log
Open
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 3.4k
- Forks
- 292
- PR merge metrics
- No merged PRs in 30d
Description
Using mssql driver:
The output from running sql-migrate:
Migration failed: mssql: Could not create constraint or index. See previous errors. handling 1529524388_create_training_plan_tables.sql
The output from Microsoft Sql Server Management Studio:
Msg 1778, Level 16, State 0, Line 43
Column 'Group.GroupID' is not the same data type as referencing column 'training_plan_group.group_id' in foreign key 'FK__training___group__4A23E96A'.
Msg 1750, Level 16, State 1, Line 43
Could not create constraint or index. See previous errors.
It seems as if only the last line of errors is output by sql-migrate.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure with the sql-migrate command, the mssql driver, and 1529524388_create_training_plan_tables.sql; compare its logged output with the SQL Server Management Studio errors. Trace how migration errors are collected and logged, then verify that all reported errors, including the underlying type mismatch and constraint error, appear in the output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100