summaryrefslogtreecommitdiff
path: root/internal/gtsmodel/tag.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2021-08-25 15:34:33 +0200
committerLibravatar GitHub <noreply@github.com>2021-08-25 15:34:33 +0200
commit2dc9fc1626507bb54417fc4a1920b847cafb27a2 (patch)
tree4ddeac479b923db38090aac8bd9209f3646851c1 /internal/gtsmodel/tag.go
parentManually approves followers (#146) (diff)
downloadgotosocial-2dc9fc1626507bb54417fc4a1920b847cafb27a2.tar.xz
Pg to bun (#148)
* start moving to bun * changing more stuff * more * and yet more * tests passing * seems stable now * more big changes * small fix * little fixes
Diffstat (limited to 'internal/gtsmodel/tag.go')
-rw-r--r--internal/gtsmodel/tag.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/internal/gtsmodel/tag.go b/internal/gtsmodel/tag.go
index 27cce1c8b..5006a36f4 100644
--- a/internal/gtsmodel/tag.go
+++ b/internal/gtsmodel/tag.go
@@ -23,21 +23,21 @@ import "time"
// Tag represents a hashtag for gathering public statuses together
type Tag struct {
// id of this tag in the database
- ID string `pg:",unique,type:CHAR(26),pk,notnull"`
+ ID string `bun:",unique,type:CHAR(26),pk,notnull"`
// Href of this tag, eg https://example.org/tags/somehashtag
URL string
// name of this tag -- the tag without the hash part
- Name string `pg:",unique,notnull"`
+ Name string `bun:",unique,notnull"`
// Which account ID is the first one we saw using this tag?
- FirstSeenFromAccountID string `pg:"type:CHAR(26)"`
+ FirstSeenFromAccountID string `bun:"type:CHAR(26),nullzero"`
// when was this tag created
- CreatedAt time.Time `pg:"type:timestamp,notnull,default:now()"`
+ CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
// when was this tag last updated
- UpdatedAt time.Time `pg:"type:timestamp,notnull,default:now()"`
+ UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
// can our instance users use this tag?
- Useable bool `pg:",notnull,default:true"`
+ Useable bool `bun:",notnull,default:true"`
// can our instance users look up this tag?
- Listable bool `pg:",notnull,default:true"`
+ Listable bool `bun:",notnull,default:true"`
// when was this tag last used?
- LastStatusAt time.Time `pg:"type:timestamp,notnull,default:now()"`
+ LastStatusAt time.Time `bun:",nullzero"`
}