bitbucket.org/Aishee/synsec@v0.0.0-20210414005726-236fc01a153d/pkg/database/ent/meta/meta.go (about) 1 // Code generated by entc, DO NOT EDIT. 2 3 package meta 4 5 import ( 6 "time" 7 ) 8 9 const ( 10 // Label holds the string label denoting the meta type in the database. 11 Label = "meta" 12 // FieldID holds the string denoting the id field in the database. 13 FieldID = "id" 14 // FieldCreatedAt holds the string denoting the created_at field in the database. 15 FieldCreatedAt = "created_at" 16 // FieldUpdatedAt holds the string denoting the updated_at field in the database. 17 FieldUpdatedAt = "updated_at" 18 // FieldKey holds the string denoting the key field in the database. 19 FieldKey = "key" 20 // FieldValue holds the string denoting the value field in the database. 21 FieldValue = "value" 22 // EdgeOwner holds the string denoting the owner edge name in mutations. 23 EdgeOwner = "owner" 24 // Table holds the table name of the meta in the database. 25 Table = "meta" 26 // OwnerTable is the table the holds the owner relation/edge. 27 OwnerTable = "meta" 28 // OwnerInverseTable is the table name for the Alert entity. 29 // It exists in this package in order to avoid circular dependency with the "alert" package. 30 OwnerInverseTable = "alerts" 31 // OwnerColumn is the table column denoting the owner relation/edge. 32 OwnerColumn = "alert_metas" 33 ) 34 35 // Columns holds all SQL columns for meta fields. 36 var Columns = []string{ 37 FieldID, 38 FieldCreatedAt, 39 FieldUpdatedAt, 40 FieldKey, 41 FieldValue, 42 } 43 44 // ForeignKeys holds the SQL foreign-keys that are owned by the "meta" 45 // table and are not defined as standalone fields in the schema. 46 var ForeignKeys = []string{ 47 "alert_metas", 48 } 49 50 // ValidColumn reports if the column name is valid (part of the table columns). 51 func ValidColumn(column string) bool { 52 for i := range Columns { 53 if column == Columns[i] { 54 return true 55 } 56 } 57 for i := range ForeignKeys { 58 if column == ForeignKeys[i] { 59 return true 60 } 61 } 62 return false 63 } 64 65 var ( 66 // DefaultCreatedAt holds the default value on creation for the "created_at" field. 67 DefaultCreatedAt func() time.Time 68 // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. 69 DefaultUpdatedAt func() time.Time 70 // ValueValidator is a validator for the "value" field. It is called by the builders before save. 71 ValueValidator func(string) error 72 )