-
Notifications
You must be signed in to change notification settings - Fork 0
/
artist.go
105 lines (99 loc) · 4.56 KB
/
artist.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// Code generated by entc, DO NOT EDIT.
package artist
const (
// Label holds the string label denoting the artist type in the database.
Label = "artist"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldName holds the string denoting the name field in the database.
FieldName = "name"
// FieldBirthday holds the string denoting the birthday field in the database.
FieldBirthday = "birthday"
// EdgeProfilePicture holds the string denoting the profile_picture edge name in mutations.
EdgeProfilePicture = "profile_picture"
// EdgePictures holds the string denoting the pictures edge name in mutations.
EdgePictures = "pictures"
// EdgeDirected holds the string denoting the directed edge name in mutations.
EdgeDirected = "directed"
// EdgeActed holds the string denoting the acted edge name in mutations.
EdgeActed = "acted"
// EdgeWrote holds the string denoting the wrote edge name in mutations.
EdgeWrote = "wrote"
// EdgeCountries holds the string denoting the countries edge name in mutations.
EdgeCountries = "countries"
// Table holds the table name of the artist in the database.
Table = "artists"
// ProfilePictureTable is the table that holds the profile_picture relation/edge.
ProfilePictureTable = "artists"
// ProfilePictureInverseTable is the table name for the Picture entity.
// It exists in this package in order to avoid circular dependency with the "picture" package.
ProfilePictureInverseTable = "pictures"
// ProfilePictureColumn is the table column denoting the profile_picture relation/edge.
ProfilePictureColumn = "artist_profile_picture"
// PicturesTable is the table that holds the pictures relation/edge.
PicturesTable = "pictures"
// PicturesInverseTable is the table name for the Picture entity.
// It exists in this package in order to avoid circular dependency with the "picture" package.
PicturesInverseTable = "pictures"
// PicturesColumn is the table column denoting the pictures relation/edge.
PicturesColumn = "artist_pictures"
// DirectedTable is the table that holds the directed relation/edge. The primary key declared below.
DirectedTable = "movie_directors"
// DirectedInverseTable is the table name for the Movie entity.
// It exists in this package in order to avoid circular dependency with the "movie" package.
DirectedInverseTable = "movies"
// ActedTable is the table that holds the acted relation/edge. The primary key declared below.
ActedTable = "movie_cast"
// ActedInverseTable is the table name for the Movie entity.
// It exists in this package in order to avoid circular dependency with the "movie" package.
ActedInverseTable = "movies"
// WroteTable is the table that holds the wrote relation/edge. The primary key declared below.
WroteTable = "movie_writers"
// WroteInverseTable is the table name for the Movie entity.
// It exists in this package in order to avoid circular dependency with the "movie" package.
WroteInverseTable = "movies"
// CountriesTable is the table that holds the countries relation/edge. The primary key declared below.
CountriesTable = "country_artists"
// CountriesInverseTable is the table name for the Country entity.
// It exists in this package in order to avoid circular dependency with the "country" package.
CountriesInverseTable = "countries"
)
// Columns holds all SQL columns for artist fields.
var Columns = []string{
FieldID,
FieldName,
FieldBirthday,
}
// ForeignKeys holds the SQL foreign-keys that are owned by the "artists"
// table and are not defined as standalone fields in the schema.
var ForeignKeys = []string{
"artist_profile_picture",
}
var (
// DirectedPrimaryKey and DirectedColumn2 are the table columns denoting the
// primary key for the directed relation (M2M).
DirectedPrimaryKey = []string{"movie_id", "artist_id"}
// ActedPrimaryKey and ActedColumn2 are the table columns denoting the
// primary key for the acted relation (M2M).
ActedPrimaryKey = []string{"movie_id", "artist_id"}
// WrotePrimaryKey and WroteColumn2 are the table columns denoting the
// primary key for the wrote relation (M2M).
WrotePrimaryKey = []string{"movie_id", "artist_id"}
// CountriesPrimaryKey and CountriesColumn2 are the table columns denoting the
// primary key for the countries relation (M2M).
CountriesPrimaryKey = []string{"country_id", "artist_id"}
)
// ValidColumn reports if the column name is valid (part of the table columns).
func ValidColumn(column string) bool {
for i := range Columns {
if column == Columns[i] {
return true
}
}
for i := range ForeignKeys {
if column == ForeignKeys[i] {
return true
}
}
return false
}