entc/gen: resolve merge conflicts on global id file (#4312)

This commit is contained in:
Jannik Clausen
2025-01-23 13:59:47 +01:00
committed by GitHub
parent ec5bfadcab
commit 0edce5f3d6
9 changed files with 137 additions and 41 deletions

View File

@@ -135,7 +135,7 @@ type Annotation struct {
//
// By default, this value is nil defaulting to whatever the database settings are.
//
IncrementStart *int64 `json:"increment_start,omitempty"`
IncrementStart *int `json:"increment_start,omitempty"`
// OnDelete specifies a custom referential action for DELETE operations on parent
// table that has matching rows in the child table.
@@ -384,7 +384,7 @@ func OnDelete(opt ReferenceOption) *Annotation {
// entsql.IncrementStart(100),
// }
// }
func IncrementStart(i int64) *Annotation {
func IncrementStart(i int) *Annotation {
return &Annotation{
IncrementStart: &i,
}

View File

@@ -860,7 +860,7 @@ func (a *Atlas) tables(tables []*Table) ([]*schema.Table, error) {
}
a.sqlDialect.atIncrementT(at, r)
case et.Annotation != nil && et.Annotation.IncrementStart != nil:
a.sqlDialect.atIncrementT(at, *et.Annotation.IncrementStart)
a.sqlDialect.atIncrementT(at, int64(*et.Annotation.IncrementStart))
}
if err := a.aColumns(et, at); err != nil {
return nil, err

View File

@@ -376,7 +376,7 @@ func TestAtlas_StateReader(t *testing.T) {
{Name: "active", Type: field.TypeBool},
},
Annotation: &entsql.Annotation{
IncrementStart: func(i int64) *int64 { return &i }(100),
IncrementStart: func(i int) *int { return &i }(100),
},
}).ReadState(context.Background())
require.NoError(t, err)