github.com/ngocphuongnb/tetua@v0.0.7-alpha/packages/entrepository/ent/permission/permission.go (about)

     1  // Code generated by entc, DO NOT EDIT.
     2  
     3  package permission
     4  
     5  import (
     6  	"time"
     7  )
     8  
     9  const (
    10  	// Label holds the string label denoting the permission type in the database.
    11  	Label = "permission"
    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  	// FieldDeletedAt holds the string denoting the deleted_at field in the database.
    19  	FieldDeletedAt = "deleted_at"
    20  	// FieldRoleID holds the string denoting the role_id field in the database.
    21  	FieldRoleID = "role_id"
    22  	// FieldAction holds the string denoting the action field in the database.
    23  	FieldAction = "action"
    24  	// FieldValue holds the string denoting the value field in the database.
    25  	FieldValue = "value"
    26  	// EdgeRole holds the string denoting the role edge name in mutations.
    27  	EdgeRole = "role"
    28  	// Table holds the table name of the permission in the database.
    29  	Table = "permissions"
    30  	// RoleTable is the table that holds the role relation/edge.
    31  	RoleTable = "permissions"
    32  	// RoleInverseTable is the table name for the Role entity.
    33  	// It exists in this package in order to avoid circular dependency with the "role" package.
    34  	RoleInverseTable = "roles"
    35  	// RoleColumn is the table column denoting the role relation/edge.
    36  	RoleColumn = "role_id"
    37  )
    38  
    39  // Columns holds all SQL columns for permission fields.
    40  var Columns = []string{
    41  	FieldID,
    42  	FieldCreatedAt,
    43  	FieldUpdatedAt,
    44  	FieldDeletedAt,
    45  	FieldRoleID,
    46  	FieldAction,
    47  	FieldValue,
    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  	return false
    58  }
    59  
    60  var (
    61  	// DefaultCreatedAt holds the default value on creation for the "created_at" field.
    62  	DefaultCreatedAt func() time.Time
    63  	// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
    64  	DefaultUpdatedAt func() time.Time
    65  	// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
    66  	UpdateDefaultUpdatedAt func() time.Time
    67  )