Skip to content

Commit

Permalink
fix: make image dimensions non-null
Browse files Browse the repository at this point in the history
  • Loading branch information
StealWonders committed Jun 14, 2024
1 parent 230b817 commit 0564dc9
Show file tree
Hide file tree
Showing 15 changed files with 54 additions and 130 deletions.
22 changes: 8 additions & 14 deletions internal/database/ent/image.go

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

10 changes: 0 additions & 10 deletions internal/database/ent/image/where.go

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

35 changes: 5 additions & 30 deletions internal/database/ent/image_create.go

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

18 changes: 0 additions & 18 deletions internal/database/ent/image_update.go

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

2 changes: 1 addition & 1 deletion internal/database/ent/migrate/schema.go

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

29 changes: 3 additions & 26 deletions internal/database/ent/mutation.go

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

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- Modify "image" table
ALTER TABLE "image" ADD COLUMN "width" bigint NOT NULL, ADD COLUMN "height" bigint NOT NULL;
4 changes: 2 additions & 2 deletions internal/database/migrations/atlas.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
h1:0SJpACBJf7MC5ntSNQ2uId9ycjBwoqpLK5SzG5A7pag=
h1:P9gL4/8NzeCC8A9H8HGlZuvWEzhqZou8KrMgxwtjukQ=
20231103235442_initial_database.sql h1:rXmCB2eMDP8LJVllwOgeBpNNXC5UyUBDx0T/gUx2Oyo=
20240202195658_remove_image_hash.sql h1:NKp3hBH792xsGZvlkinuBnr44L9Bi9a0RS5CO+tIDE4=
20240614062517_add_image_dimensions.sql h1:DvSf1670+WnBYu+3fa7KSb6UEHs3Swx715B1wmPOhoU=
20240614195816_add_image_dimensions.sql h1:CErHJ7Umz3qO3v0/EyxkvasRIp2zV042F/yaxozzh3w=
4 changes: 2 additions & 2 deletions internal/database/schema/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ func (Image) Annotations() []schema.Annotation {
func (Image) Fields() []ent.Field {
return []ent.Field{
field.UUID("id", uuid.UUID{}).Default(uuid.New).Immutable(),
field.Int("width").Positive().Optional().Nillable(),
field.Int("height").Positive().Nillable(),
field.Int("width").Positive(),
field.Int("height").Positive(),
}
}

Expand Down
32 changes: 22 additions & 10 deletions internal/graphql/gqlserver/generated.go

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

4 changes: 2 additions & 2 deletions internal/graphql/models/generated.go

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

Loading

0 comments on commit 0564dc9

Please sign in to comment.