only use nullzero if string/timme.Time

Signed-off-by: kim (grufwub) <grufwub@gmail.com>
This commit is contained in:
kim (grufwub) 2021-08-27 09:50:02 +01:00
commit 8c5a906881
7 changed files with 14 additions and 14 deletions

View file

@ -78,13 +78,13 @@ type Account struct {
*/ */
// Does this account need an approval for new followers? // 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? // 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 // Default post privacy for this account
Privacy Visibility `bun:",nullzero,default:'public'"` Privacy Visibility `bun:",nullzero,default:'public'"`
// Set posts from this account to sensitive by default? // 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? // What language does this account post in?
Language string `bun:",nullzero,notnull,default:'en'"` Language string `bun:",nullzero,notnull,default:'en'"`

View file

@ -67,11 +67,11 @@ type Emoji struct {
// When was the emoji image last updated? // When was the emoji image last updated?
ImageUpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"` ImageUpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
// Has a moderation action disabled this emoji from being shown? // 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' // ActivityStreams uri of this emoji. Something like 'https://example.org/emojis/1234'
URI string `bun:",notnull,unique"` URI string `bun:",notnull,unique"`
// Is this emoji visible in the admin emoji picker? // 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? // In which emoji category is this emoji visible?
CategoryID string `bun:"type:CHAR(26),nullzero"` CategoryID string `bun:"type:CHAR(26),nullzero"`
} }

View file

@ -35,7 +35,7 @@ type Follow struct {
TargetAccountID string `bun:"type:CHAR(26),unique:srctarget,notnull"` TargetAccountID string `bun:"type:CHAR(26),unique:srctarget,notnull"`
TargetAccount *Account `bun:"rel:belongs-to"` TargetAccount *Account `bun:"rel:belongs-to"`
// Does this follow also want to see reblogs and not just posts? // 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? // What is the activitypub URI of this follow?
URI string `bun:",unique,nullzero"` URI string `bun:",unique,nullzero"`
// does the following account want to be notified when the followed account posts? // does the following account want to be notified when the followed account posts?

View file

@ -35,7 +35,7 @@ type FollowRequest struct {
TargetAccountID string `bun:"type:CHAR(26),unique:frsrctarget,notnull"` TargetAccountID string `bun:"type:CHAR(26),unique:frsrctarget,notnull"`
TargetAccount *Account `bun:"rel:belongs-to"` TargetAccount *Account `bun:"rel:belongs-to"`
// Does this follow also want to see reblogs and not just posts? // 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? // What is the activitypub URI of this follow request?
URI string `bun:",unique,nullzero"` URI string `bun:",unique,nullzero"`
// does the following account want to be notified when the followed account posts? // does the following account want to be notified when the followed account posts?

View file

@ -35,7 +35,7 @@ type Instance struct {
ContactAccountID string `bun:"type:CHAR(26),nullzero"` ContactAccountID string `bun:"type:CHAR(26),nullzero"`
ContactAccount *Account `bun:"rel:belongs-to"` ContactAccount *Account `bun:"rel:belongs-to"`
// Reputation score of this instance // 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 of the software used on this instance
Version string `bun:",nullzero"` Version string `bun:",nullzero"`
} }

View file

@ -138,11 +138,11 @@ const (
// If DIRECT is selected, boostable will be FALSE, and all other flags will be TRUE. // If DIRECT is selected, boostable will be FALSE, and all other flags will be TRUE.
type VisibilityAdvanced struct { type VisibilityAdvanced struct {
// This status will be federated beyond the local timeline(s) // 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 // This status can be boosted/reblogged
Boostable bool `bun:",nullzero,default:true"` Boostable bool `bun:",default:true"`
// This status can be replied to // This status can be replied to
Replyable bool `bun:",nullzero,default:true"` Replyable bool `bun:",default:true"`
// This status can be liked/faved // This status can be liked/faved
Likeable bool `bun:",nullzero,default:true"` Likeable bool `bun:",default:true"`
} }

View file

@ -35,9 +35,9 @@ type Tag struct {
// when was this tag last updated // when was this tag last updated
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"` UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
// can our instance users use this tag? // 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? // 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? // when was this tag last used?
LastStatusAt time.Time `bun:",nullzero"` LastStatusAt time.Time `bun:",nullzero"`
} }