Skip to content

Commit

Permalink
update mysql type for file content (#638)
Browse files Browse the repository at this point in the history
  • Loading branch information
KCarretto authored Feb 21, 2024
1 parent 0892744 commit c766cbf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tavern/internal/ent/migrate/schema.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions tavern/internal/ent/schema/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"entgo.io/contrib/entgql"
"entgo.io/ent"
"entgo.io/ent/dialect"
"entgo.io/ent/schema"
"entgo.io/ent/schema/edge"
"entgo.io/ent/schema/field"
Expand Down Expand Up @@ -40,6 +41,9 @@ func (File) Fields() []ent.Field {
MaxLen(100).
Comment("A SHA3-256 digest of the content field"),
field.Bytes("content").
SchemaType(map[string]string{
dialect.MySQL: "LONGBLOB", // Override MySQL, improve length maximum
}).
Annotations(
entgql.Skip(), // Don't return file content in GraphQL queries
).
Expand Down

0 comments on commit c766cbf

Please sign in to comment.