Add migration to strip out subsecond timestamps

This commit is contained in:
moredhel 2022-10-02 00:57:18 +00:00
parent ef0cf8bf49
commit d607e1ceb4
1 changed files with 33 additions and 0 deletions

33
migrations/v11.go Normal file
View File

@ -0,0 +1,33 @@
/*
* Copyright © 2020 A Bunch Tell LLC.
*
* This file is part of WriteFreely.
*
* WriteFreely is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, included
* in the LICENSE file in this source code package.
*/
package migrations
func supportPostSignatures(db *datastore) error {
t, err := db.Begin()
if err != nil {
t.Rollback()
return err
}
_, err = t.Exec(`UPDATE posts SET created = DATETIME(created)`)
if err != nil {
t.Rollback()
return err
}
err = t.Commit()
if err != nil {
t.Rollback()
return err
}
return nil
}