From 2dc9fc1626507bb54417fc4a1920b847cafb27a2 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Wed, 25 Aug 2021 15:34:33 +0200 Subject: 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 --- internal/gtsmodel/tag.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'internal/gtsmodel/tag.go') 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"` } -- cgit v1.2.3