convert epoch to milliseconds

This commit is contained in:
ryan
2018-03-22 16:21:47 +01:00
parent a2bbd89a9e
commit 20353db966
3 changed files with 22 additions and 18 deletions
@@ -106,4 +106,13 @@ func addAnnotationMig(mg *Migrator) {
mg.AddMigration("Add index for updated in annotation table", NewAddIndexMigration(table, &Index{
Cols: []string{"org_id", "updated"}, Type: IndexType,
}))
//
// Convert epoch saved as seconds to miliseconds
//
updateEpochSql := "UPDATE annotation SET epoch = (epoch*1000)"
mg.AddMigration("Convert existing annotations from seconds to miliseconds", new(RawSqlMigration).
Sqlite(updateEpochSql).
Postgres(updateEpochSql).
Mysql(updateEpochSql))
}