main

mattermost/focalboard

Last updated at: 29/12/2023 09:40

migration35_test.go

TLDR

This file contains a test case for the migration process related to adding a hidden column to category boards.

Methods (if applicable)

N/A

Classes (if applicable)

N/A

package migrationstests

import "testing"

func Test35AddHIddenColumnToCategoryBoards(t *testing.T) {
	t.Run("base case - column doesn't already exist", func(t *testing.T) {
		th, tearDown := SetupTestHelper(t)
		defer tearDown()
		th.f.MigrateToStep(35)
	})

	t.Run("column already exist", func(t *testing.T) {
		th, tearDown := SetupTestHelper(t)
		defer tearDown()

		// We don't support adding column in idempotent manner
		// for SQLite, so no need to check for it.
		if th.IsSQLite() {
			return
		}

		th.f.MigrateToStep(34).
			ExecFile("./fixtures/test35_add_hidden_column.sql")

		th.f.MigrateToStep(35)
	})
}