Unistore: Add generation column (#102222)
This commit is contained in:
@@ -152,7 +152,19 @@ func initResourceTables(mg *migrator.Migrator) string {
|
||||
mg.AddMigration("Migrate DeletionMarkers to real Resource objects", &deletionMarkerMigrator{})
|
||||
|
||||
mg.AddMigration("Add index to resource_history for get trash", migrator.NewAddIndexMigration(resource_history_table, &migrator.Index{
|
||||
Name: "IDX_resource_history_namespace_group_resource_action_version", Cols: []string{"namespace", "group", "resource", "action", "resource_version"}, Type: migrator.IndexType,
|
||||
Name: "IDX_resource_history_namespace_group_resource_action_version",
|
||||
Cols: []string{"namespace", "group", "resource", "action", "resource_version"},
|
||||
Type: migrator.IndexType,
|
||||
}))
|
||||
|
||||
// Add generation column so we can use it for more aggressive pruning
|
||||
mg.AddMigration("Add generation to resource history", migrator.NewAddColumnMigration(resource_history_table, &migrator.Column{
|
||||
Name: "generation", Type: migrator.DB_BigInt, Nullable: false, Default: "0",
|
||||
}))
|
||||
mg.AddMigration("Add generation index to resource history", migrator.NewAddIndexMigration(resource_history_table, &migrator.Index{
|
||||
Cols: []string{"namespace", "group", "resource", "name", "generation"},
|
||||
Type: migrator.IndexType,
|
||||
Name: "IDX_resource_history_namespace_group_resource_name_generation",
|
||||
}))
|
||||
|
||||
return marker
|
||||
|
||||
Reference in New Issue
Block a user