/
places.go
37 lines (33 loc) · 1.03 KB
/
places.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package model
import (
"time"
)
type Place struct {
ID string `gorm:"type:char(36);primary_key"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt *time.Time `sql:"index"`
PlaceTypeId string `gorm:"UNIQUE_INDEX:compositeindex;index;not null"`
PlaceType PlaceType `gorm:"UNIQUE_INDEX:compositeindex;type:text;not null"`
AdminOrigin bool
ServiceProviderId string `gorm:"UNIQUE_INDEX:compositeindex;index;not null"`
ServiceProvider ServiceProvider `gorm:"UNIQUE_INDEX:compositeindex;type:text;not null"`
PlacePics []PlacePic `gorm:"polymorphic:Owner"`
}
type PlaceType struct {
ID string `gorm:"type:char(36);primary_key"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt *time.Time `sql:"index"`
TypeName string
Image string
}
type PlacePic struct {
ID string `gorm:"type:char(36);primary_key"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt *time.Time `sql:"index"`
Pic string
OwnerID string
OwnerType string
}