forked from src-d/go-kallax
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathschema.go
More file actions
30 lines (26 loc) · 702 Bytes
/
schema.go
File metadata and controls
30 lines (26 loc) · 702 Bytes
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
package tests
import "gopkg.in/src-d/go-kallax.v1"
type SchemaFixture struct {
kallax.Model `table:"schema"`
ID kallax.ULID `pk:""`
ShouldIgnore string `kallax:"-"`
String string
Int int
Nested *SchemaFixture
Inline struct {
Inline string
} `kallax:",inline"`
MapOfString map[string]string
MapOfInterface map[string]interface{}
MapOfSomeType map[string]struct {
Foo string
}
Inverse *SchemaRelationshipFixture `fk:"rel_id,inverse"`
}
type SchemaRelationshipFixture struct {
kallax.Model `table:"relationship"`
ID kallax.ULID `pk:""`
}
func newSchemaFixture() *SchemaFixture {
return &SchemaFixture{ID: kallax.NewULID()}
}