bitbucket.org/Aishee/synsec@v0.0.0-20210414005726-236fc01a153d/pkg/database/ent/decision/decision.go (about)

     1  // Code generated by entc, DO NOT EDIT.
     2  
     3  package decision
     4  
     5  import (
     6  	"time"
     7  )
     8  
     9  const (
    10  	// Label holds the string label denoting the decision type in the database.
    11  	Label = "decision"
    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  	// FieldUntil holds the string denoting the until field in the database.
    19  	FieldUntil = "until"
    20  	// FieldScenario holds the string denoting the scenario field in the database.
    21  	FieldScenario = "scenario"
    22  	// FieldType holds the string denoting the type field in the database.
    23  	FieldType = "type"
    24  	// FieldStartIP holds the string denoting the start_ip field in the database.
    25  	FieldStartIP = "start_ip"
    26  	// FieldEndIP holds the string denoting the end_ip field in the database.
    27  	FieldEndIP = "end_ip"
    28  	// FieldStartSuffix holds the string denoting the start_suffix field in the database.
    29  	FieldStartSuffix = "start_suffix"
    30  	// FieldEndSuffix holds the string denoting the end_suffix field in the database.
    31  	FieldEndSuffix = "end_suffix"
    32  	// FieldIPSize holds the string denoting the ip_size field in the database.
    33  	FieldIPSize = "ip_size"
    34  	// FieldScope holds the string denoting the scope field in the database.
    35  	FieldScope = "scope"
    36  	// FieldValue holds the string denoting the value field in the database.
    37  	FieldValue = "value"
    38  	// FieldOrigin holds the string denoting the origin field in the database.
    39  	FieldOrigin = "origin"
    40  	// FieldSimulated holds the string denoting the simulated field in the database.
    41  	FieldSimulated = "simulated"
    42  	// EdgeOwner holds the string denoting the owner edge name in mutations.
    43  	EdgeOwner = "owner"
    44  	// Table holds the table name of the decision in the database.
    45  	Table = "decisions"
    46  	// OwnerTable is the table the holds the owner relation/edge.
    47  	OwnerTable = "decisions"
    48  	// OwnerInverseTable is the table name for the Alert entity.
    49  	// It exists in this package in order to avoid circular dependency with the "alert" package.
    50  	OwnerInverseTable = "alerts"
    51  	// OwnerColumn is the table column denoting the owner relation/edge.
    52  	OwnerColumn = "alert_decisions"
    53  )
    54  
    55  // Columns holds all SQL columns for decision fields.
    56  var Columns = []string{
    57  	FieldID,
    58  	FieldCreatedAt,
    59  	FieldUpdatedAt,
    60  	FieldUntil,
    61  	FieldScenario,
    62  	FieldType,
    63  	FieldStartIP,
    64  	FieldEndIP,
    65  	FieldStartSuffix,
    66  	FieldEndSuffix,
    67  	FieldIPSize,
    68  	FieldScope,
    69  	FieldValue,
    70  	FieldOrigin,
    71  	FieldSimulated,
    72  }
    73  
    74  // ForeignKeys holds the SQL foreign-keys that are owned by the "decisions"
    75  // table and are not defined as standalone fields in the schema.
    76  var ForeignKeys = []string{
    77  	"alert_decisions",
    78  }
    79  
    80  // ValidColumn reports if the column name is valid (part of the table columns).
    81  func ValidColumn(column string) bool {
    82  	for i := range Columns {
    83  		if column == Columns[i] {
    84  			return true
    85  		}
    86  	}
    87  	for i := range ForeignKeys {
    88  		if column == ForeignKeys[i] {
    89  			return true
    90  		}
    91  	}
    92  	return false
    93  }
    94  
    95  var (
    96  	// DefaultCreatedAt holds the default value on creation for the "created_at" field.
    97  	DefaultCreatedAt func() time.Time
    98  	// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
    99  	DefaultUpdatedAt func() time.Time
   100  	// DefaultSimulated holds the default value on creation for the "simulated" field.
   101  	DefaultSimulated bool
   102  )