Skip to content

Commit

Permalink
feat: code nillable
Browse files Browse the repository at this point in the history
  • Loading branch information
ernado committed Dec 8, 2024
1 parent 5f7c87d commit f13aa8e
Show file tree
Hide file tree
Showing 10 changed files with 257 additions and 31 deletions.
6 changes: 3 additions & 3 deletions internal/ent/migrate/schema.go

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

66 changes: 63 additions & 3 deletions internal/ent/mutation.go

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

12 changes: 9 additions & 3 deletions internal/ent/schema/telegram_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ type TelegramAccount struct {
func (TelegramAccount) Fields() []ent.Field {
return []ent.Field{
field.String("id").Comment("Phone number without +"),
field.String("code"),
field.Time("code_at"),
field.String("code").
Optional().
Nillable(),
field.Time("code_at").
Optional().
Nillable(),
field.Enum("state").
Values("New", "CodeSent", "Active", "Error").Default("New"),
field.String("status"),
field.Bytes("session").Nillable(),
field.Bytes("session").
Optional().
Nillable(),
}
}

Expand Down
22 changes: 14 additions & 8 deletions internal/ent/telegramaccount.go

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

30 changes: 30 additions & 0 deletions internal/ent/telegramaccount/where.go

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

Loading

0 comments on commit f13aa8e

Please sign in to comment.