Locations added
This commit is contained in:
16
backend/core/models/locations.go
Normal file
16
backend/core/models/locations.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package models
|
||||
|
||||
import "github.com/uptrace/bun"
|
||||
|
||||
type Location struct {
|
||||
bun.BaseModel `bun:"table:locations"`
|
||||
|
||||
ID int `bun:"id,pk,autoincrement" json:"id"`
|
||||
Street string `bun:"street,notnull,unique:location" json:"street"`
|
||||
City string `bun:"city,notnull,unique:location" json:"city"`
|
||||
PostalCode string `bun:"postal_code,notnull,unique:location" json:"postalCode"`
|
||||
Latitude *float64 `bun:"latitude" json:"latitude,omitempty"`
|
||||
Longitude *float64 `bun:"longitude" json:"longitude,omitempty"`
|
||||
|
||||
Events *[]Event `bun:"-" json:"events,omitempty"`
|
||||
}
|
||||
Reference in New Issue
Block a user