adding created column

This commit is contained in:
ryan
2018-03-22 02:22:58 +01:00
parent 624dac16fa
commit 3898ea02e6
4 changed files with 28 additions and 1 deletions

View File

@@ -90,4 +90,14 @@ func addAnnotationMig(mg *Migrator) {
Sqlite(updateTextFieldSql).
Postgres(updateTextFieldSql).
Mysql(updateTextFieldSql))
//
// Add a 'created' column
//
mg.AddMigration("Add created time to annotation table", NewAddColumnMigration(table, &Column{
Name: "created", 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,
}))
}