adding updated column

This commit is contained in:
ryan
2018-03-22 15:52:09 +01:00
parent df94b380f4
commit a2bbd89a9e
6 changed files with 29 additions and 14 deletions

View File

@@ -92,12 +92,18 @@ func addAnnotationMig(mg *Migrator) {
Mysql(updateTextFieldSql))
//
// Add a 'created' column
// Add a 'created' & 'updated' column
//
mg.AddMigration("Add created time to annotation table", NewAddColumnMigration(table, &Column{
Name: "created", Type: DB_BigInt, Nullable: true, Default: "0",
}))
mg.AddMigration("Add updated time to annotation table", NewAddColumnMigration(table, &Column{
Name: "updated", Type: DB_BigInt, Nullable: true, Default: "0",
}))
mg.AddMigration("Add index for created in annotation table", NewAddIndexMigration(table, &Index{
Cols: []string{"org_id", "created"}, Type: IndexType,
}))
mg.AddMigration("Add index for updated in annotation table", NewAddIndexMigration(table, &Index{
Cols: []string{"org_id", "updated"}, Type: IndexType,
}))
}