summaryrefslogtreecommitdiff
path: root/internal/gtsmodel
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2024-10-19 11:04:07 +0200
committerLibravatar GitHub <noreply@github.com>2024-10-19 11:04:07 +0200
commitfab7d170319856993fe15563c801b3084def0e85 (patch)
tree353a5a146d2fe686bdd70f20ecbf9298b4a27669 /internal/gtsmodel
parent[chore] Fix loop issue in streaming 🤦 (#3457) (diff)
downloadgotosocial-fab7d170319856993fe15563c801b3084def0e85.tar.xz
[bugfix] Fix filter title unique constraint (#3458)
Diffstat (limited to 'internal/gtsmodel')
-rw-r--r--internal/gtsmodel/filter.go28
1 files changed, 14 insertions, 14 deletions
diff --git a/internal/gtsmodel/filter.go b/internal/gtsmodel/filter.go
index 95047a44f..593918ec1 100644
--- a/internal/gtsmodel/filter.go
+++ b/internal/gtsmodel/filter.go
@@ -26,20 +26,20 @@ import (
// Filter stores a filter created by a local account.
type Filter struct {
- ID string `bun:"type:CHAR(26),pk,nullzero,notnull,unique"` // id of this item in the database
- CreatedAt time.Time `bun:"type:timestamptz,nullzero,notnull,default:current_timestamp"` // when was item created
- UpdatedAt time.Time `bun:"type:timestamptz,nullzero,notnull,default:current_timestamp"` // when was item last updated
- ExpiresAt time.Time `bun:"type:timestamptz,nullzero"` // Time filter should expire. If null, should not expire.
- AccountID string `bun:"type:CHAR(26),notnull,nullzero"` // ID of the local account that created the filter.
- Title string `bun:",nullzero,notnull,unique"` // The name of the filter.
- Action FilterAction `bun:",nullzero,notnull"` // The action to take.
- Keywords []*FilterKeyword `bun:"-"` // Keywords for this filter.
- Statuses []*FilterStatus `bun:"-"` // Statuses for this filter.
- ContextHome *bool `bun:",nullzero,notnull,default:false"` // Apply filter to home timeline and lists.
- ContextNotifications *bool `bun:",nullzero,notnull,default:false"` // Apply filter to notifications.
- ContextPublic *bool `bun:",nullzero,notnull,default:false"` // Apply filter to home timeline and lists.
- ContextThread *bool `bun:",nullzero,notnull,default:false"` // Apply filter when viewing a status's associated thread.
- ContextAccount *bool `bun:",nullzero,notnull,default:false"` // Apply filter when viewing an account profile.
+ ID string `bun:"type:CHAR(26),pk,nullzero,notnull,unique"` // id of this item in the database
+ CreatedAt time.Time `bun:"type:timestamptz,nullzero,notnull,default:current_timestamp"` // when was item created
+ UpdatedAt time.Time `bun:"type:timestamptz,nullzero,notnull,default:current_timestamp"` // when was item last updated
+ ExpiresAt time.Time `bun:"type:timestamptz,nullzero"` // Time filter should expire. If null, should not expire.
+ AccountID string `bun:"type:CHAR(26),notnull,nullzero,unique:filters_account_id_title_uniq"` // ID of the local account that created the filter.
+ Title string `bun:",nullzero,notnull,unique:filters_account_id_title_uniq"` // The name of the filter.
+ Action FilterAction `bun:",nullzero,notnull"` // The action to take.
+ Keywords []*FilterKeyword `bun:"-"` // Keywords for this filter.
+ Statuses []*FilterStatus `bun:"-"` // Statuses for this filter.
+ ContextHome *bool `bun:",nullzero,notnull,default:false"` // Apply filter to home timeline and lists.
+ ContextNotifications *bool `bun:",nullzero,notnull,default:false"` // Apply filter to notifications.
+ ContextPublic *bool `bun:",nullzero,notnull,default:false"` // Apply filter to home timeline and lists.
+ ContextThread *bool `bun:",nullzero,notnull,default:false"` // Apply filter when viewing a status's associated thread.
+ ContextAccount *bool `bun:",nullzero,notnull,default:false"` // Apply filter when viewing an account profile.
}
// Expired returns whether the filter has expired at a given time.