|
|
@@ -14,6 +14,8 @@ var customMigrations = []CustomMigration{ |
|
|
|
{"Custom v1 Topic struct change to support chinese", syncTopicStruct}, |
|
|
|
} |
|
|
|
|
|
|
|
var customMigrationsStatic = []CustomMigration{} |
|
|
|
|
|
|
|
func MigrateCustom(x *xorm.Engine) { |
|
|
|
|
|
|
|
for _, m := range customMigrations { |
|
|
@@ -27,6 +29,17 @@ func MigrateCustom(x *xorm.Engine) { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
func MigrateCustomStatic(x *xorm.Engine) { |
|
|
|
for _, m := range customMigrationsStatic { |
|
|
|
log.Info("Migration: %s", m.Description) |
|
|
|
if err := m.Migrate(x); err != nil { |
|
|
|
|
|
|
|
log.Error("Migration: %v", err) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
func syncTopicStruct(x *xorm.Engine) error { |
|
|
|
|
|
|
|
query := "ALTER TABLE topic ALTER COLUMN name TYPE varchar(105);" |
|
|
|