-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathxorm.go
59 lines (47 loc) · 1015 Bytes
/
xorm.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package xorms
import (
"github.com/volatiletech/null/v8"
)
// Pilot struct
type Pilot struct {
Id int `xorm:"pk"`
Name string `xorm:"not null"`
Languages []Language `xorm:"extends"`
}
// Jet struct
type Jet struct {
Id int `xorm:"pk"`
PilotId int `xorm:"not null"`
AirportId int `xorm:"not null"`
Name string `xorm:"not null"`
Color null.String
Uuid string `xorm:"not null"`
Identifier string `xorm:"not null"`
Cargo []byte `xorm:"not null"`
Manifest []byte `xorm:"not null"`
}
// Airport struct
type Airport struct {
Id int `xorm:"pk"`
Size null.Int
}
// License struct
type License struct {
Id int `xorm:"pk"`
Pilot Pilot
PilotId int
}
// Hangar struct
type Hangar struct {
Id int `xorm:"pk"`
Name string `xorm:"not null"`
}
// Language struct
type Language struct {
Id int `xorm:"pk"`
Language string `xorm:"index not null"`
}
type PilotLanguage struct {
PilotId int `xorm:"pk"`
LanguageId int `xorm:"pk"`
}