blob: 0ad89cf7411cafa6f86d311024d72406d9e57c68 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
package model
import (
"strings"
"time"
"github.com/uptrace/bun"
)
type Quote struct {
bun.BaseModel `bun:"table:quotes,alias:q"`
ID int64 `bun:",pk,autoincrement"`
Quote string `bun:",notnull"`
Approved bool
Archive bool
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
DeletedAt time.Time `bun:",soft_delete,nullzero"`
}
func (q *Quote) Text() string {
return strings.ReplaceAll(q.Quote, "\n", "<br />")
}
|