Add ResourceType filter to dal alteration struct
This commit is contained in:
parent
58ea38233e
commit
28774f0f1c
4
server/store/adapters/rdbms/filters.gen.go
generated
4
server/store/adapters/rdbms/filters.gen.go
generated
@ -823,6 +823,10 @@ func DalSchemaAlterationFilter(d drivers.Dialect, f systemType.DalSchemaAlterati
|
||||
ee = append(ee, goqu.C("resource").In(ss))
|
||||
}
|
||||
|
||||
if val := strings.TrimSpace(f.ResourceType); len(val) > 0 {
|
||||
ee = append(ee, goqu.C("resource_type").Eq(f.ResourceType))
|
||||
}
|
||||
|
||||
if len(f.AlterationID) > 0 {
|
||||
ee = append(ee, goqu.C("id").In(f.AlterationID))
|
||||
}
|
||||
|
||||
@ -84,6 +84,7 @@ dal_schema_alteration: {
|
||||
filter: {
|
||||
struct: {
|
||||
resource: {goType: "[]string", ident: "resource" }
|
||||
resourceType: {goType: "string", ident: "resourceType", storeIdent: "resource_type" }
|
||||
alteration_id: {goType: "[]uint64", ident: "alterationID", storeIdent: "id" }
|
||||
batch_id: {goType: "uint64", ident: "batchID" }
|
||||
kind: {}
|
||||
@ -92,7 +93,7 @@ dal_schema_alteration: {
|
||||
dismissed: {goType: "filter.State", storeIdent: "dismissed_at"}
|
||||
}
|
||||
|
||||
byValue: ["kind", "resource", "alteration_id", "batch_id"]
|
||||
byValue: ["kind", "resource", "resourceType", "alteration_id", "batch_id"]
|
||||
byNilState: ["deleted", "completed", "dismissed"]
|
||||
}
|
||||
|
||||
|
||||
@ -94,10 +94,11 @@ func (svc dalSchemaAlteration) ModelAlterations(ctx context.Context, m *dal.Mode
|
||||
|
||||
func (svc dalSchemaAlteration) modelAlterations(ctx context.Context, s store.Storer, m *dal.Model) (out []*dal.Alteration, err error) {
|
||||
aux, _, err := store.SearchDalSchemaAlterations(ctx, s, types.DalSchemaAlterationFilter{
|
||||
Resource: []string{m.Resource},
|
||||
Deleted: filter.StateExcluded,
|
||||
Completed: filter.StateExcluded,
|
||||
Dismissed: filter.StateExcluded,
|
||||
Resource: []string{m.Resource},
|
||||
ResourceType: m.ResourceType,
|
||||
Deleted: filter.StateExcluded,
|
||||
Completed: filter.StateExcluded,
|
||||
Dismissed: filter.StateExcluded,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@ -52,6 +52,7 @@ type (
|
||||
BatchID uint64 `json:"batchID,string"`
|
||||
Kind string `json:"kind"`
|
||||
Resource []string `json:"resource"`
|
||||
ResourceType string `json:"resourceType"`
|
||||
|
||||
Deleted filter.State `json:"deleted"`
|
||||
Completed filter.State `json:"completed"`
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user