1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

golang-migrateを使ってる際の"Dirty database version 3. Fix and force version." の対処法

Posted at

遭遇したエラー

golang-migrateでupする際にシンタックスエラーを含むファイルで実行したため下記のエラーに遭遇しました。

error: Dirty database version 3. Fix and force version.
make: *** [migrate-up] Error 1

対処法

こちらのエラーになった際は下記の二点を実行して再度upしてあげると正常に走らせることができます。

①データベースのschema_migrationsにてdirtyのカラムが1になっているレコードを削除
②原因となったマイグレーションファイルのエラーを修正
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?