mirror of
https://github.com/mattermost/mattermost.git
synced 2026-02-03 20:40:00 -05:00
https://mattermost.atlassian.net/browse/MM-63368 ```release-note Remove MySQL support from the codebase entirely. ```
37 lines
914 B
Go
37 lines
914 B
Go
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
package sqlstore
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/mattermost/mattermost/server/public/model"
|
|
"github.com/mattermost/mattermost/server/public/shared/mlog"
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestUpAndDownMigrations(t *testing.T) {
|
|
logger := mlog.CreateTestLogger(t)
|
|
|
|
testDrivers := []string{
|
|
model.DatabaseDriverPostgres,
|
|
}
|
|
|
|
for _, driver := range testDrivers {
|
|
t.Run("Should be reversible for "+driver, func(t *testing.T) {
|
|
settings, err := makeSqlSettings(driver)
|
|
if err != nil {
|
|
t.Skip(err)
|
|
}
|
|
|
|
store, err := New(*settings, logger, nil)
|
|
require.NoError(t, err)
|
|
defer store.Close()
|
|
|
|
err = store.migrate(migrationsDirectionDown, false, true)
|
|
assert.NoError(t, err, "downing migrations should not error")
|
|
})
|
|
}
|
|
}
|