Skip to content

Commit 7249759

Browse files
committed
fix(ent): question > category should not be unique and immutable
1 parent 9f3368c commit 7249759

File tree

6 files changed

+55
-3
lines changed

6 files changed

+55
-3
lines changed

ent/gql_mutation_input.go

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ent/internal/schema.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ent/migrate/schema.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ent/question_update.go

Lines changed: 44 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ent/schema/question.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type Question struct {
1414

1515
func (Question) Fields() []ent.Field {
1616
return []ent.Field{
17-
field.String("category").NotEmpty().Unique().Immutable().Comment("Question category, e.g. 'query'").Annotations(
17+
field.String("category").NotEmpty().Comment("Question category, e.g. 'query'").Annotations(
1818
entgql.OrderField("CATEGORY"),
1919
),
2020
field.Enum("difficulty").NamedValues(

graph/ent.graphqls

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,6 +1224,10 @@ UpdateQuestionInput is used for update Question object.
12241224
Input was generated by ent.
12251225
"""
12261226
input UpdateQuestionInput {
1227+
"""
1228+
Question category, e.g. 'query'
1229+
"""
1230+
category: String
12271231
"""
12281232
Question difficulty, e.g. 'easy'
12291233
"""

0 commit comments

Comments
 (0)