[feature/backend] add categories param in posts
This commit is contained in:
parent
958e3c2886
commit
be8bf22017
21 changed files with 448 additions and 281 deletions
|
@ -262,10 +262,10 @@ func (cu *CategoryUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
|||
}
|
||||
if cu.mutation.PostsCleared() {
|
||||
edge := &sqlgraph.EdgeSpec{
|
||||
Rel: sqlgraph.O2M,
|
||||
Rel: sqlgraph.M2M,
|
||||
Inverse: false,
|
||||
Table: category.PostsTable,
|
||||
Columns: []string{category.PostsColumn},
|
||||
Columns: category.PostsPrimaryKey,
|
||||
Bidi: false,
|
||||
Target: &sqlgraph.EdgeTarget{
|
||||
IDSpec: sqlgraph.NewFieldSpec(post.FieldID, field.TypeInt),
|
||||
|
@ -275,10 +275,10 @@ func (cu *CategoryUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
|||
}
|
||||
if nodes := cu.mutation.RemovedPostsIDs(); len(nodes) > 0 && !cu.mutation.PostsCleared() {
|
||||
edge := &sqlgraph.EdgeSpec{
|
||||
Rel: sqlgraph.O2M,
|
||||
Rel: sqlgraph.M2M,
|
||||
Inverse: false,
|
||||
Table: category.PostsTable,
|
||||
Columns: []string{category.PostsColumn},
|
||||
Columns: category.PostsPrimaryKey,
|
||||
Bidi: false,
|
||||
Target: &sqlgraph.EdgeTarget{
|
||||
IDSpec: sqlgraph.NewFieldSpec(post.FieldID, field.TypeInt),
|
||||
|
@ -291,10 +291,10 @@ func (cu *CategoryUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
|||
}
|
||||
if nodes := cu.mutation.PostsIDs(); len(nodes) > 0 {
|
||||
edge := &sqlgraph.EdgeSpec{
|
||||
Rel: sqlgraph.O2M,
|
||||
Rel: sqlgraph.M2M,
|
||||
Inverse: false,
|
||||
Table: category.PostsTable,
|
||||
Columns: []string{category.PostsColumn},
|
||||
Columns: category.PostsPrimaryKey,
|
||||
Bidi: false,
|
||||
Target: &sqlgraph.EdgeTarget{
|
||||
IDSpec: sqlgraph.NewFieldSpec(post.FieldID, field.TypeInt),
|
||||
|
@ -631,10 +631,10 @@ func (cuo *CategoryUpdateOne) sqlSave(ctx context.Context) (_node *Category, err
|
|||
}
|
||||
if cuo.mutation.PostsCleared() {
|
||||
edge := &sqlgraph.EdgeSpec{
|
||||
Rel: sqlgraph.O2M,
|
||||
Rel: sqlgraph.M2M,
|
||||
Inverse: false,
|
||||
Table: category.PostsTable,
|
||||
Columns: []string{category.PostsColumn},
|
||||
Columns: category.PostsPrimaryKey,
|
||||
Bidi: false,
|
||||
Target: &sqlgraph.EdgeTarget{
|
||||
IDSpec: sqlgraph.NewFieldSpec(post.FieldID, field.TypeInt),
|
||||
|
@ -644,10 +644,10 @@ func (cuo *CategoryUpdateOne) sqlSave(ctx context.Context) (_node *Category, err
|
|||
}
|
||||
if nodes := cuo.mutation.RemovedPostsIDs(); len(nodes) > 0 && !cuo.mutation.PostsCleared() {
|
||||
edge := &sqlgraph.EdgeSpec{
|
||||
Rel: sqlgraph.O2M,
|
||||
Rel: sqlgraph.M2M,
|
||||
Inverse: false,
|
||||
Table: category.PostsTable,
|
||||
Columns: []string{category.PostsColumn},
|
||||
Columns: category.PostsPrimaryKey,
|
||||
Bidi: false,
|
||||
Target: &sqlgraph.EdgeTarget{
|
||||
IDSpec: sqlgraph.NewFieldSpec(post.FieldID, field.TypeInt),
|
||||
|
@ -660,10 +660,10 @@ func (cuo *CategoryUpdateOne) sqlSave(ctx context.Context) (_node *Category, err
|
|||
}
|
||||
if nodes := cuo.mutation.PostsIDs(); len(nodes) > 0 {
|
||||
edge := &sqlgraph.EdgeSpec{
|
||||
Rel: sqlgraph.O2M,
|
||||
Rel: sqlgraph.M2M,
|
||||
Inverse: false,
|
||||
Table: category.PostsTable,
|
||||
Columns: []string{category.PostsColumn},
|
||||
Columns: category.PostsPrimaryKey,
|
||||
Bidi: false,
|
||||
Target: &sqlgraph.EdgeTarget{
|
||||
IDSpec: sqlgraph.NewFieldSpec(post.FieldID, field.TypeInt),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue