Этот коммит содержится в:
Christopher Speller
2015-10-20 14:04:14 -04:00
родитель 4ed9a9ebca b8eb11a439
Коммит 8b4771a6c7
5 изменённых файлов: 189 добавлений и 9 удалений

Просмотреть файл

@@ -79,7 +79,14 @@ func NewSqlStore() Store {
// Check to see if it's the most current database schema version
if !model.IsCurrentVersion(schemaVersion) {
// If we are upgrading from the previous version then print a warning and continue
if model.IsPreviousVersion(schemaVersion) {
// Special case
isSchemaVersion07 := false
if schemaVersion == "0.7.1" || schemaVersion == "0.7.0" {
isSchemaVersion07 = true
}
if model.IsPreviousVersion(schemaVersion) || isSchemaVersion07 {
l4g.Warn("The database schema version of " + schemaVersion + " appears to be out of date")
l4g.Warn("Attempting to upgrade the database schema version to " + model.CurrentVersion)
} else {
@@ -91,6 +98,13 @@ func NewSqlStore() Store {
}
}
// REMOVE in 1.2
if sqlStore.DoesTableExist("Sessions") {
if sqlStore.DoesColumnExist("Sessions", "AltId") {
sqlStore.GetMaster().Exec("DROP TABLE IF EXISTS Sessions")
}
}
sqlStore.team = NewSqlTeamStore(sqlStore)
sqlStore.channel = NewSqlChannelStore(sqlStore)
sqlStore.post = NewSqlPostStore(sqlStore)