Fix addtag removing newlines

This commit is contained in:
Dustin Pianalto
2020-09-01 21:36:14 -08:00
parent 30394b35e5
commit fb4d7977aa
3 changed files with 26 additions and 20 deletions
+21
View File
@@ -16,6 +16,10 @@ var postfixes = []postfix{
Name: "1_Update_X_Guild_Prefixes_to_add_ID",
Invoke: updateXGuildPrefixesToAddID,
},
postfix{
Name: "1_Update_Tags_Content_Length",
Invoke: updateTagsContentLength,
},
}
func RunPostfixes() {
@@ -75,3 +79,20 @@ func updateXGuildPrefixesToAddID(revert bool) error {
}
return nil
}
func updateTagsContentLength(revert bool) error {
var queryString string
if !revert {
queryString = `ALTER TABLE tags
ALTER COLUMN content TYPE varchar(2000)`
} else {
queryString = `ALTER TABLE tags
ALTER COLUMN content TYPE varchar(1000)`
}
_, err := Database.Exec(queryString)
if err != nil {
log.Println(err)
return err
}
return nil
}