From 8c5a9068817411138b0a7c4b735dfec48a836418 Mon Sep 17 00:00:00 2001 From: "kim (grufwub)" Date: Fri, 27 Aug 2021 09:50:02 +0100 Subject: [PATCH] only use nullzero if string/timme.Time Signed-off-by: kim (grufwub) --- internal/gtsmodel/account.go | 6 +++--- internal/gtsmodel/emoji.go | 4 ++-- internal/gtsmodel/follow.go | 2 +- internal/gtsmodel/followrequest.go | 2 +- internal/gtsmodel/instance.go | 2 +- internal/gtsmodel/status.go | 8 ++++---- internal/gtsmodel/tag.go | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/internal/gtsmodel/account.go b/internal/gtsmodel/account.go index 87b0ff3af..4ebb492de 100644 --- a/internal/gtsmodel/account.go +++ b/internal/gtsmodel/account.go @@ -78,13 +78,13 @@ type Account struct { */ // Does this account need an approval for new followers? - Locked bool `bun:",nullzero,default:true"` + Locked bool `bun:",default:true"` // Should this account be shown in the instance's profile directory? - Discoverable bool `bun:",nullzero,default:false"` + Discoverable bool `bun:",default:false"` // Default post privacy for this account Privacy Visibility `bun:",nullzero,default:'public'"` // Set posts from this account to sensitive by default? - Sensitive bool `bun:",nullzero,default:false"` + Sensitive bool `bun:",default:false"` // What language does this account post in? Language string `bun:",nullzero,notnull,default:'en'"` diff --git a/internal/gtsmodel/emoji.go b/internal/gtsmodel/emoji.go index 971254d15..98a52c744 100644 --- a/internal/gtsmodel/emoji.go +++ b/internal/gtsmodel/emoji.go @@ -67,11 +67,11 @@ type Emoji struct { // When was the emoji image last updated? ImageUpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"` // Has a moderation action disabled this emoji from being shown? - Disabled bool `bun:",nullzero,notnull,default:false"` + Disabled bool `bun:",notnull,default:false"` // ActivityStreams uri of this emoji. Something like 'https://example.org/emojis/1234' URI string `bun:",notnull,unique"` // Is this emoji visible in the admin emoji picker? - VisibleInPicker bool `bun:",nullzero,notnull,default:true"` + VisibleInPicker bool `bun:",notnull,default:true"` // In which emoji category is this emoji visible? CategoryID string `bun:"type:CHAR(26),nullzero"` } diff --git a/internal/gtsmodel/follow.go b/internal/gtsmodel/follow.go index 45d04bd22..dfa1860ab 100644 --- a/internal/gtsmodel/follow.go +++ b/internal/gtsmodel/follow.go @@ -35,7 +35,7 @@ type Follow struct { TargetAccountID string `bun:"type:CHAR(26),unique:srctarget,notnull"` TargetAccount *Account `bun:"rel:belongs-to"` // Does this follow also want to see reblogs and not just posts? - ShowReblogs bool `bun:",nullzero,default:true"` + ShowReblogs bool `bun:",default:true"` // What is the activitypub URI of this follow? URI string `bun:",unique,nullzero"` // does the following account want to be notified when the followed account posts? diff --git a/internal/gtsmodel/followrequest.go b/internal/gtsmodel/followrequest.go index b8f189df9..12f9e1725 100644 --- a/internal/gtsmodel/followrequest.go +++ b/internal/gtsmodel/followrequest.go @@ -35,7 +35,7 @@ type FollowRequest struct { TargetAccountID string `bun:"type:CHAR(26),unique:frsrctarget,notnull"` TargetAccount *Account `bun:"rel:belongs-to"` // Does this follow also want to see reblogs and not just posts? - ShowReblogs bool `bun:",nullzero,default:true"` + ShowReblogs bool `bun:",default:true"` // What is the activitypub URI of this follow request? URI string `bun:",unique,nullzero"` // does the following account want to be notified when the followed account posts? diff --git a/internal/gtsmodel/instance.go b/internal/gtsmodel/instance.go index 6ddb33617..ca2857b95 100644 --- a/internal/gtsmodel/instance.go +++ b/internal/gtsmodel/instance.go @@ -35,7 +35,7 @@ type Instance struct { ContactAccountID string `bun:"type:CHAR(26),nullzero"` ContactAccount *Account `bun:"rel:belongs-to"` // Reputation score of this instance - Reputation int64 `bun:",nullzero,notnull,default:0"` + Reputation int64 `bun:",notnull,default:0"` // Version of the software used on this instance Version string `bun:",nullzero"` } diff --git a/internal/gtsmodel/status.go b/internal/gtsmodel/status.go index 2dc94a087..07c2e9795 100644 --- a/internal/gtsmodel/status.go +++ b/internal/gtsmodel/status.go @@ -138,11 +138,11 @@ const ( // If DIRECT is selected, boostable will be FALSE, and all other flags will be TRUE. type VisibilityAdvanced struct { // This status will be federated beyond the local timeline(s) - Federated bool `bun:",nullzero,default:true"` + Federated bool `bun:",default:true"` // This status can be boosted/reblogged - Boostable bool `bun:",nullzero,default:true"` + Boostable bool `bun:",default:true"` // This status can be replied to - Replyable bool `bun:",nullzero,default:true"` + Replyable bool `bun:",default:true"` // This status can be liked/faved - Likeable bool `bun:",nullzero,default:true"` + Likeable bool `bun:",default:true"` } diff --git a/internal/gtsmodel/tag.go b/internal/gtsmodel/tag.go index 9933c0234..d4be0b66c 100644 --- a/internal/gtsmodel/tag.go +++ b/internal/gtsmodel/tag.go @@ -35,9 +35,9 @@ type Tag struct { // when was this tag last updated UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"` // can our instance users use this tag? - Useable bool `bun:",nullzero,notnull,default:true"` + Useable bool `bun:",notnull,default:true"` // can our instance users look up this tag? - Listable bool `bun:",nullzero,notnull,default:true"` + Listable bool `bun:",notnull,default:true"` // when was this tag last used? LastStatusAt time.Time `bun:",nullzero"` }