Rename address.geom to address.location
It's a better name.
This commit is contained in:
parent
e44bc62325
commit
4494bd97cf
9 changed files with 93 additions and 88 deletions
|
|
@ -33,8 +33,8 @@ var Addresses = Table[
|
|||
Generated: false,
|
||||
AutoIncr: false,
|
||||
},
|
||||
Geom: column{
|
||||
Name: "geom",
|
||||
Location: column{
|
||||
Name: "location",
|
||||
DBType: "geometry",
|
||||
Default: "",
|
||||
Comment: "",
|
||||
|
|
@ -138,7 +138,7 @@ var Addresses = Table[
|
|||
Name: "idx_address_geom",
|
||||
Columns: []indexColumn{
|
||||
{
|
||||
Name: "geom",
|
||||
Name: "location",
|
||||
Desc: null.FromCond(false, true),
|
||||
IsExpression: false,
|
||||
},
|
||||
|
|
@ -163,7 +163,7 @@ var Addresses = Table[
|
|||
type addressColumns struct {
|
||||
Country column
|
||||
Created column
|
||||
Geom column
|
||||
Location column
|
||||
H3cell column
|
||||
ID column
|
||||
Locality column
|
||||
|
|
@ -176,7 +176,7 @@ type addressColumns struct {
|
|||
|
||||
func (c addressColumns) AsSlice() []column {
|
||||
return []column{
|
||||
c.Country, c.Created, c.Geom, c.H3cell, c.ID, c.Locality, c.PostalCode, c.Street, c.Unit, c.Region, c.Number,
|
||||
c.Country, c.Created, c.Location, c.H3cell, c.ID, c.Locality, c.PostalCode, c.Street, c.Unit, c.Region, c.Number,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ var ReviewTaskPools = Table[
|
|||
Schema: "",
|
||||
Name: "review_task_pool",
|
||||
Columns: reviewTaskPoolColumns{
|
||||
FeaturePool: column{
|
||||
Name: "feature_pool",
|
||||
FeaturePoolID: column{
|
||||
Name: "feature_pool_id",
|
||||
DBType: "integer",
|
||||
Default: "",
|
||||
Comment: "",
|
||||
|
|
@ -80,7 +80,7 @@ var ReviewTaskPools = Table[
|
|||
ReviewTaskPoolReviewTaskPoolFeaturePoolFkey: foreignKey{
|
||||
constraint: constraint{
|
||||
Name: "review_task_pool.review_task_pool_feature_pool_fkey",
|
||||
Columns: []string{"feature_pool"},
|
||||
Columns: []string{"feature_pool_id"},
|
||||
Comment: "",
|
||||
},
|
||||
ForeignTable: "feature_pool",
|
||||
|
|
@ -101,15 +101,15 @@ var ReviewTaskPools = Table[
|
|||
}
|
||||
|
||||
type reviewTaskPoolColumns struct {
|
||||
FeaturePool column
|
||||
Location column
|
||||
Geometry column
|
||||
ReviewTaskID column
|
||||
FeaturePoolID column
|
||||
Location column
|
||||
Geometry column
|
||||
ReviewTaskID column
|
||||
}
|
||||
|
||||
func (c reviewTaskPoolColumns) AsSlice() []column {
|
||||
return []column{
|
||||
c.FeaturePool, c.Location, c.Geometry, c.ReviewTaskID,
|
||||
c.FeaturePoolID, c.Location, c.Geometry, c.ReviewTaskID,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ CREATE TABLE review_task (
|
|||
PRIMARY KEY(id)
|
||||
);
|
||||
CREATE TABLE review_task_pool (
|
||||
feature_pool INTEGER NOT NULL REFERENCES feature_pool(feature_id),
|
||||
feature_pool_id INTEGER NOT NULL REFERENCES feature_pool(feature_id),
|
||||
location geometry(Point, 4326),
|
||||
geometry geometry(Polygon, 4326),
|
||||
review_task_id INTEGER NOT NULL REFERENCES review_task(id),
|
||||
|
|
|
|||
5
db/migrations/00091_address_location.sql
Normal file
5
db/migrations/00091_address_location.sql
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
-- +goose Up
|
||||
ALTER TABLE address RENAME COLUMN geom TO location;
|
||||
-- +goose Down
|
||||
ALTER TABLE address RENAME COLUMN location TO geom;
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ import (
|
|||
type Address struct {
|
||||
Country enums.Countrytype `db:"country" `
|
||||
Created time.Time `db:"created" `
|
||||
Geom string `db:"geom" `
|
||||
Location string `db:"location" `
|
||||
H3cell string `db:"h3cell" `
|
||||
ID int32 `db:"id,pk" `
|
||||
Locality string `db:"locality" `
|
||||
|
|
@ -59,12 +59,12 @@ type addressR struct {
|
|||
func buildAddressColumns(alias string) addressColumns {
|
||||
return addressColumns{
|
||||
ColumnsExpr: expr.NewColumnsExpr(
|
||||
"country", "created", "geom", "h3cell", "id", "locality", "postal_code", "street", "unit", "region", "number_",
|
||||
"country", "created", "location", "h3cell", "id", "locality", "postal_code", "street", "unit", "region", "number_",
|
||||
).WithParent("address"),
|
||||
tableAlias: alias,
|
||||
Country: psql.Quote(alias, "country"),
|
||||
Created: psql.Quote(alias, "created"),
|
||||
Geom: psql.Quote(alias, "geom"),
|
||||
Location: psql.Quote(alias, "location"),
|
||||
H3cell: psql.Quote(alias, "h3cell"),
|
||||
ID: psql.Quote(alias, "id"),
|
||||
Locality: psql.Quote(alias, "locality"),
|
||||
|
|
@ -81,7 +81,7 @@ type addressColumns struct {
|
|||
tableAlias string
|
||||
Country psql.Expression
|
||||
Created psql.Expression
|
||||
Geom psql.Expression
|
||||
Location psql.Expression
|
||||
H3cell psql.Expression
|
||||
ID psql.Expression
|
||||
Locality psql.Expression
|
||||
|
|
@ -106,7 +106,7 @@ func (addressColumns) AliasedAs(alias string) addressColumns {
|
|||
type AddressSetter struct {
|
||||
Country omit.Val[enums.Countrytype] `db:"country" `
|
||||
Created omit.Val[time.Time] `db:"created" `
|
||||
Geom omit.Val[string] `db:"geom" `
|
||||
Location omit.Val[string] `db:"location" `
|
||||
H3cell omit.Val[string] `db:"h3cell" `
|
||||
ID omit.Val[int32] `db:"id,pk" `
|
||||
Locality omit.Val[string] `db:"locality" `
|
||||
|
|
@ -125,8 +125,8 @@ func (s AddressSetter) SetColumns() []string {
|
|||
if s.Created.IsValue() {
|
||||
vals = append(vals, "created")
|
||||
}
|
||||
if s.Geom.IsValue() {
|
||||
vals = append(vals, "geom")
|
||||
if s.Location.IsValue() {
|
||||
vals = append(vals, "location")
|
||||
}
|
||||
if s.H3cell.IsValue() {
|
||||
vals = append(vals, "h3cell")
|
||||
|
|
@ -162,8 +162,8 @@ func (s AddressSetter) Overwrite(t *Address) {
|
|||
if s.Created.IsValue() {
|
||||
t.Created = s.Created.MustGet()
|
||||
}
|
||||
if s.Geom.IsValue() {
|
||||
t.Geom = s.Geom.MustGet()
|
||||
if s.Location.IsValue() {
|
||||
t.Location = s.Location.MustGet()
|
||||
}
|
||||
if s.H3cell.IsValue() {
|
||||
t.H3cell = s.H3cell.MustGet()
|
||||
|
|
@ -210,8 +210,8 @@ func (s *AddressSetter) Apply(q *dialect.InsertQuery) {
|
|||
vals[1] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Geom.IsValue() {
|
||||
vals[2] = psql.Arg(s.Geom.MustGet())
|
||||
if s.Location.IsValue() {
|
||||
vals[2] = psql.Arg(s.Location.MustGet())
|
||||
} else {
|
||||
vals[2] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -289,10 +289,10 @@ func (s AddressSetter) Expressions(prefix ...string) []bob.Expression {
|
|||
}})
|
||||
}
|
||||
|
||||
if s.Geom.IsValue() {
|
||||
if s.Location.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "geom")...),
|
||||
psql.Arg(s.Geom),
|
||||
psql.Quote(append(prefix, "location")...),
|
||||
psql.Arg(s.Location),
|
||||
}})
|
||||
}
|
||||
|
||||
|
|
@ -843,7 +843,7 @@ func (address0 *Address) AttachSite(ctx context.Context, exec bob.Executor, site
|
|||
type addressWhere[Q psql.Filterable] struct {
|
||||
Country psql.WhereMod[Q, enums.Countrytype]
|
||||
Created psql.WhereMod[Q, time.Time]
|
||||
Geom psql.WhereMod[Q, string]
|
||||
Location psql.WhereMod[Q, string]
|
||||
H3cell psql.WhereMod[Q, string]
|
||||
ID psql.WhereMod[Q, int32]
|
||||
Locality psql.WhereMod[Q, string]
|
||||
|
|
@ -862,7 +862,7 @@ func buildAddressWhere[Q psql.Filterable](cols addressColumns) addressWhere[Q] {
|
|||
return addressWhere[Q]{
|
||||
Country: psql.Where[Q, enums.Countrytype](cols.Country),
|
||||
Created: psql.Where[Q, time.Time](cols.Created),
|
||||
Geom: psql.Where[Q, string](cols.Geom),
|
||||
Location: psql.Where[Q, string](cols.Location),
|
||||
H3cell: psql.Where[Q, string](cols.H3cell),
|
||||
ID: psql.Where[Q, int32](cols.ID),
|
||||
Locality: psql.Where[Q, string](cols.Locality),
|
||||
|
|
|
|||
|
|
@ -444,7 +444,7 @@ func (os FeaturePoolSlice) Feature(mods ...bob.Mod[*dialect.SelectQuery]) Featur
|
|||
// ReviewTaskPools starts a query for related objects on review_task_pool
|
||||
func (o *FeaturePool) ReviewTaskPools(mods ...bob.Mod[*dialect.SelectQuery]) ReviewTaskPoolsQuery {
|
||||
return ReviewTaskPools.Query(append(mods,
|
||||
sm.Where(ReviewTaskPools.Columns.FeaturePool.EQ(psql.Arg(o.FeatureID))),
|
||||
sm.Where(ReviewTaskPools.Columns.FeaturePoolID.EQ(psql.Arg(o.FeatureID))),
|
||||
)...)
|
||||
}
|
||||
|
||||
|
|
@ -461,7 +461,7 @@ func (os FeaturePoolSlice) ReviewTaskPools(mods ...bob.Mod[*dialect.SelectQuery]
|
|||
))
|
||||
|
||||
return ReviewTaskPools.Query(append(mods,
|
||||
sm.Where(psql.Group(ReviewTaskPools.Columns.FeaturePool).OP("IN", PKArgExpr)),
|
||||
sm.Where(psql.Group(ReviewTaskPools.Columns.FeaturePoolID).OP("IN", PKArgExpr)),
|
||||
)...)
|
||||
}
|
||||
|
||||
|
|
@ -515,7 +515,7 @@ func (featurePool0 *FeaturePool) AttachFeature(ctx context.Context, exec bob.Exe
|
|||
|
||||
func insertFeaturePoolReviewTaskPools0(ctx context.Context, exec bob.Executor, reviewTaskPools1 []*ReviewTaskPoolSetter, featurePool0 *FeaturePool) (ReviewTaskPoolSlice, error) {
|
||||
for i := range reviewTaskPools1 {
|
||||
reviewTaskPools1[i].FeaturePool = omit.From(featurePool0.FeatureID)
|
||||
reviewTaskPools1[i].FeaturePoolID = omit.From(featurePool0.FeatureID)
|
||||
}
|
||||
|
||||
ret, err := ReviewTaskPools.Insert(bob.ToMods(reviewTaskPools1...)).All(ctx, exec)
|
||||
|
|
@ -528,7 +528,7 @@ func insertFeaturePoolReviewTaskPools0(ctx context.Context, exec bob.Executor, r
|
|||
|
||||
func attachFeaturePoolReviewTaskPools0(ctx context.Context, exec bob.Executor, count int, reviewTaskPools1 ReviewTaskPoolSlice, featurePool0 *FeaturePool) (ReviewTaskPoolSlice, error) {
|
||||
setter := &ReviewTaskPoolSetter{
|
||||
FeaturePool: omit.From(featurePool0.FeatureID),
|
||||
FeaturePoolID: omit.From(featurePool0.FeatureID),
|
||||
}
|
||||
|
||||
err := reviewTaskPools1.UpdateAll(ctx, exec, *setter)
|
||||
|
|
@ -789,7 +789,7 @@ func (os FeaturePoolSlice) LoadReviewTaskPools(ctx context.Context, exec bob.Exe
|
|||
|
||||
for _, rel := range reviewTaskPools {
|
||||
|
||||
if !(o.FeatureID == rel.FeaturePool) {
|
||||
if !(o.FeatureID == rel.FeaturePoolID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,10 +24,10 @@ import (
|
|||
|
||||
// ReviewTaskPool is an object representing the database table.
|
||||
type ReviewTaskPool struct {
|
||||
FeaturePool int32 `db:"feature_pool" `
|
||||
Location null.Val[string] `db:"location" `
|
||||
Geometry null.Val[string] `db:"geometry" `
|
||||
ReviewTaskID int32 `db:"review_task_id,pk" `
|
||||
FeaturePoolID int32 `db:"feature_pool_id" `
|
||||
Location null.Val[string] `db:"location" `
|
||||
Geometry null.Val[string] `db:"geometry" `
|
||||
ReviewTaskID int32 `db:"review_task_id,pk" `
|
||||
|
||||
R reviewTaskPoolR `db:"-" `
|
||||
}
|
||||
|
|
@ -51,23 +51,23 @@ type reviewTaskPoolR struct {
|
|||
func buildReviewTaskPoolColumns(alias string) reviewTaskPoolColumns {
|
||||
return reviewTaskPoolColumns{
|
||||
ColumnsExpr: expr.NewColumnsExpr(
|
||||
"feature_pool", "location", "geometry", "review_task_id",
|
||||
"feature_pool_id", "location", "geometry", "review_task_id",
|
||||
).WithParent("review_task_pool"),
|
||||
tableAlias: alias,
|
||||
FeaturePool: psql.Quote(alias, "feature_pool"),
|
||||
Location: psql.Quote(alias, "location"),
|
||||
Geometry: psql.Quote(alias, "geometry"),
|
||||
ReviewTaskID: psql.Quote(alias, "review_task_id"),
|
||||
tableAlias: alias,
|
||||
FeaturePoolID: psql.Quote(alias, "feature_pool_id"),
|
||||
Location: psql.Quote(alias, "location"),
|
||||
Geometry: psql.Quote(alias, "geometry"),
|
||||
ReviewTaskID: psql.Quote(alias, "review_task_id"),
|
||||
}
|
||||
}
|
||||
|
||||
type reviewTaskPoolColumns struct {
|
||||
expr.ColumnsExpr
|
||||
tableAlias string
|
||||
FeaturePool psql.Expression
|
||||
Location psql.Expression
|
||||
Geometry psql.Expression
|
||||
ReviewTaskID psql.Expression
|
||||
tableAlias string
|
||||
FeaturePoolID psql.Expression
|
||||
Location psql.Expression
|
||||
Geometry psql.Expression
|
||||
ReviewTaskID psql.Expression
|
||||
}
|
||||
|
||||
func (c reviewTaskPoolColumns) Alias() string {
|
||||
|
|
@ -82,16 +82,16 @@ func (reviewTaskPoolColumns) AliasedAs(alias string) reviewTaskPoolColumns {
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type ReviewTaskPoolSetter struct {
|
||||
FeaturePool omit.Val[int32] `db:"feature_pool" `
|
||||
Location omitnull.Val[string] `db:"location" `
|
||||
Geometry omitnull.Val[string] `db:"geometry" `
|
||||
ReviewTaskID omit.Val[int32] `db:"review_task_id,pk" `
|
||||
FeaturePoolID omit.Val[int32] `db:"feature_pool_id" `
|
||||
Location omitnull.Val[string] `db:"location" `
|
||||
Geometry omitnull.Val[string] `db:"geometry" `
|
||||
ReviewTaskID omit.Val[int32] `db:"review_task_id,pk" `
|
||||
}
|
||||
|
||||
func (s ReviewTaskPoolSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 4)
|
||||
if s.FeaturePool.IsValue() {
|
||||
vals = append(vals, "feature_pool")
|
||||
if s.FeaturePoolID.IsValue() {
|
||||
vals = append(vals, "feature_pool_id")
|
||||
}
|
||||
if !s.Location.IsUnset() {
|
||||
vals = append(vals, "location")
|
||||
|
|
@ -106,8 +106,8 @@ func (s ReviewTaskPoolSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s ReviewTaskPoolSetter) Overwrite(t *ReviewTaskPool) {
|
||||
if s.FeaturePool.IsValue() {
|
||||
t.FeaturePool = s.FeaturePool.MustGet()
|
||||
if s.FeaturePoolID.IsValue() {
|
||||
t.FeaturePoolID = s.FeaturePoolID.MustGet()
|
||||
}
|
||||
if !s.Location.IsUnset() {
|
||||
t.Location = s.Location.MustGetNull()
|
||||
|
|
@ -127,8 +127,8 @@ func (s *ReviewTaskPoolSetter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.StringWriter, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 4)
|
||||
if s.FeaturePool.IsValue() {
|
||||
vals[0] = psql.Arg(s.FeaturePool.MustGet())
|
||||
if s.FeaturePoolID.IsValue() {
|
||||
vals[0] = psql.Arg(s.FeaturePoolID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -162,10 +162,10 @@ func (s ReviewTaskPoolSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
func (s ReviewTaskPoolSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 4)
|
||||
|
||||
if s.FeaturePool.IsValue() {
|
||||
if s.FeaturePoolID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "feature_pool")...),
|
||||
psql.Arg(s.FeaturePool),
|
||||
psql.Quote(append(prefix, "feature_pool_id")...),
|
||||
psql.Arg(s.FeaturePoolID),
|
||||
}})
|
||||
}
|
||||
|
||||
|
|
@ -417,22 +417,22 @@ func (o ReviewTaskPoolSlice) ReloadAll(ctx context.Context, exec bob.Executor) e
|
|||
}
|
||||
|
||||
// FeaturePool starts a query for related objects on feature_pool
|
||||
func (o *ReviewTaskPool) RelatedFeaturePool(mods ...bob.Mod[*dialect.SelectQuery]) FeaturePoolsQuery {
|
||||
func (o *ReviewTaskPool) FeaturePool(mods ...bob.Mod[*dialect.SelectQuery]) FeaturePoolsQuery {
|
||||
return FeaturePools.Query(append(mods,
|
||||
sm.Where(FeaturePools.Columns.FeatureID.EQ(psql.Arg(o.FeaturePool))),
|
||||
sm.Where(FeaturePools.Columns.FeatureID.EQ(psql.Arg(o.FeaturePoolID))),
|
||||
)...)
|
||||
}
|
||||
|
||||
func (os ReviewTaskPoolSlice) RelatedFeaturePool(mods ...bob.Mod[*dialect.SelectQuery]) FeaturePoolsQuery {
|
||||
pkFeaturePool := make(pgtypes.Array[int32], 0, len(os))
|
||||
func (os ReviewTaskPoolSlice) FeaturePool(mods ...bob.Mod[*dialect.SelectQuery]) FeaturePoolsQuery {
|
||||
pkFeaturePoolID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
}
|
||||
pkFeaturePool = append(pkFeaturePool, o.FeaturePool)
|
||||
pkFeaturePoolID = append(pkFeaturePoolID, o.FeaturePoolID)
|
||||
}
|
||||
PKArgExpr := psql.Select(sm.Columns(
|
||||
psql.F("unnest", psql.Cast(psql.Arg(pkFeaturePool), "integer[]")),
|
||||
psql.F("unnest", psql.Cast(psql.Arg(pkFeaturePoolID), "integer[]")),
|
||||
))
|
||||
|
||||
return FeaturePools.Query(append(mods,
|
||||
|
|
@ -466,7 +466,7 @@ func (os ReviewTaskPoolSlice) ReviewTask(mods ...bob.Mod[*dialect.SelectQuery])
|
|||
|
||||
func attachReviewTaskPoolFeaturePool0(ctx context.Context, exec bob.Executor, count int, reviewTaskPool0 *ReviewTaskPool, featurePool1 *FeaturePool) (*ReviewTaskPool, error) {
|
||||
setter := &ReviewTaskPoolSetter{
|
||||
FeaturePool: omit.From(featurePool1.FeatureID),
|
||||
FeaturePoolID: omit.From(featurePool1.FeatureID),
|
||||
}
|
||||
|
||||
err := reviewTaskPool0.Update(ctx, exec, setter)
|
||||
|
|
@ -561,10 +561,10 @@ func (reviewTaskPool0 *ReviewTaskPool) AttachReviewTask(ctx context.Context, exe
|
|||
}
|
||||
|
||||
type reviewTaskPoolWhere[Q psql.Filterable] struct {
|
||||
FeaturePool psql.WhereMod[Q, int32]
|
||||
Location psql.WhereNullMod[Q, string]
|
||||
Geometry psql.WhereNullMod[Q, string]
|
||||
ReviewTaskID psql.WhereMod[Q, int32]
|
||||
FeaturePoolID psql.WhereMod[Q, int32]
|
||||
Location psql.WhereNullMod[Q, string]
|
||||
Geometry psql.WhereNullMod[Q, string]
|
||||
ReviewTaskID psql.WhereMod[Q, int32]
|
||||
}
|
||||
|
||||
func (reviewTaskPoolWhere[Q]) AliasedAs(alias string) reviewTaskPoolWhere[Q] {
|
||||
|
|
@ -573,10 +573,10 @@ func (reviewTaskPoolWhere[Q]) AliasedAs(alias string) reviewTaskPoolWhere[Q] {
|
|||
|
||||
func buildReviewTaskPoolWhere[Q psql.Filterable](cols reviewTaskPoolColumns) reviewTaskPoolWhere[Q] {
|
||||
return reviewTaskPoolWhere[Q]{
|
||||
FeaturePool: psql.Where[Q, int32](cols.FeaturePool),
|
||||
Location: psql.WhereNull[Q, string](cols.Location),
|
||||
Geometry: psql.WhereNull[Q, string](cols.Geometry),
|
||||
ReviewTaskID: psql.Where[Q, int32](cols.ReviewTaskID),
|
||||
FeaturePoolID: psql.Where[Q, int32](cols.FeaturePoolID),
|
||||
Location: psql.WhereNull[Q, string](cols.Location),
|
||||
Geometry: psql.WhereNull[Q, string](cols.Geometry),
|
||||
ReviewTaskID: psql.Where[Q, int32](cols.ReviewTaskID),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -629,7 +629,7 @@ func buildReviewTaskPoolPreloader() reviewTaskPoolPreloader {
|
|||
{
|
||||
From: ReviewTaskPools,
|
||||
To: FeaturePools,
|
||||
FromColumns: []string{"feature_pool"},
|
||||
FromColumns: []string{"feature_pool_id"},
|
||||
ToColumns: []string{"feature_id"},
|
||||
},
|
||||
},
|
||||
|
|
@ -689,7 +689,7 @@ func (o *ReviewTaskPool) LoadFeaturePool(ctx context.Context, exec bob.Executor,
|
|||
// Reset the relationship
|
||||
o.R.FeaturePool = nil
|
||||
|
||||
related, err := o.RelatedFeaturePool(mods...).One(ctx, exec)
|
||||
related, err := o.FeaturePool(mods...).One(ctx, exec)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -706,7 +706,7 @@ func (os ReviewTaskPoolSlice) LoadFeaturePool(ctx context.Context, exec bob.Exec
|
|||
return nil
|
||||
}
|
||||
|
||||
featurePools, err := os.RelatedFeaturePool(mods...).All(ctx, exec)
|
||||
featurePools, err := os.FeaturePool(mods...).All(ctx, exec)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -718,7 +718,7 @@ func (os ReviewTaskPoolSlice) LoadFeaturePool(ctx context.Context, exec bob.Exec
|
|||
|
||||
for _, rel := range featurePools {
|
||||
|
||||
if !(o.FeaturePool == rel.FeatureID) {
|
||||
if !(o.FeaturePoolID == rel.FeatureID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue