bitbucket.org/Aishee/synsec@v0.0.0-20210414005726-236fc01a153d/pkg/database/ent/machine/machine.go (about) 1 // Code generated by entc, DO NOT EDIT. 2 3 package machine 4 5 import ( 6 "time" 7 ) 8 9 const ( 10 // Label holds the string label denoting the machine type in the database. 11 Label = "machine" 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 // FieldMachineId holds the string denoting the machineid field in the database. 19 FieldMachineId = "machine_id" 20 // FieldPassword holds the string denoting the password field in the database. 21 FieldPassword = "password" 22 // FieldIpAddress holds the string denoting the ipaddress field in the database. 23 FieldIpAddress = "ip_address" 24 // FieldScenarios holds the string denoting the scenarios field in the database. 25 FieldScenarios = "scenarios" 26 // FieldVersion holds the string denoting the version field in the database. 27 FieldVersion = "version" 28 // FieldIsValidated holds the string denoting the isvalidated field in the database. 29 FieldIsValidated = "is_validated" 30 // FieldStatus holds the string denoting the status field in the database. 31 FieldStatus = "status" 32 // EdgeAlerts holds the string denoting the alerts edge name in mutations. 33 EdgeAlerts = "alerts" 34 // Table holds the table name of the machine in the database. 35 Table = "machines" 36 // AlertsTable is the table the holds the alerts relation/edge. 37 AlertsTable = "alerts" 38 // AlertsInverseTable is the table name for the Alert entity. 39 // It exists in this package in order to avoid circular dependency with the "alert" package. 40 AlertsInverseTable = "alerts" 41 // AlertsColumn is the table column denoting the alerts relation/edge. 42 AlertsColumn = "machine_alerts" 43 ) 44 45 // Columns holds all SQL columns for machine fields. 46 var Columns = []string{ 47 FieldID, 48 FieldCreatedAt, 49 FieldUpdatedAt, 50 FieldMachineId, 51 FieldPassword, 52 FieldIpAddress, 53 FieldScenarios, 54 FieldVersion, 55 FieldIsValidated, 56 FieldStatus, 57 } 58 59 // ValidColumn reports if the column name is valid (part of the table columns). 60 func ValidColumn(column string) bool { 61 for i := range Columns { 62 if column == Columns[i] { 63 return true 64 } 65 } 66 return false 67 } 68 69 var ( 70 // DefaultCreatedAt holds the default value on creation for the "created_at" field. 71 DefaultCreatedAt func() time.Time 72 // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. 73 DefaultUpdatedAt func() time.Time 74 // ScenariosValidator is a validator for the "scenarios" field. It is called by the builders before save. 75 ScenariosValidator func(string) error 76 // DefaultIsValidated holds the default value on creation for the "isValidated" field. 77 DefaultIsValidated bool 78 )