rubenv / rubenv/sql-migrate

When migration generates an error not all errors are output in the log

Open
#117 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.