onepanel icon indicating copy to clipboard operation
onepanel copied to clipboard

Add descriptive method for go migrations indicating why we check if sql migrations ran

Open Vafilor opened this issue 4 years ago • 1 comments

In our go migrations, we have code like this

	migrationsRan, err := getRanSQLMigrations(client)
	if err != nil {
		return err
	}

	if _, ok := migrationsRan[20200727144157]; ok {
		return nil
	}

This is a backwards compatibility check. Some of these go migrations used to be in the same directory as sql migrations and ran at the same time, so that migration might have already been run in earlier systems.

This is not clear in the code. I had to read it and wonder why we were doing that.

Add a method that does this check and document it so it is clear what is going on.

Vafilor avatar Jul 28 '20 19:07 Vafilor

Issue-Label Bot is automatically applying the label kind/enhancement to this issue, with a confidence of 0.75. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

issue-label-bot[bot] avatar Jul 28 '20 19:07 issue-label-bot[bot]