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

     1  // Code generated by entc, DO NOT EDIT.
     2  
     3  package role
     4  
     5  import (
     6  	"time"
     7  )
     8  
     9  const (
    10  	// Label holds the string label denoting the role type in the database.
    11  	Label = "role"
    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  	// FieldName holds the string denoting the name field in the database.
    21  	FieldName = "name"
    22  	// FieldDescription holds the string denoting the description field in the database.
    23  	FieldDescription = "description"
    24  	// FieldRoot holds the string denoting the root field in the database.
    25  	FieldRoot = "root"
    26  	// EdgePermissions holds the string denoting the permissions edge name in mutations.
    27  	EdgePermissions = "permissions"
    28  	// EdgeUsers holds the string denoting the users edge name in mutations.
    29  	EdgeUsers = "users"
    30  	// Table holds the table name of the role in the database.
    31  	Table = "roles"
    32  	// PermissionsTable is the table that holds the permissions relation/edge.
    33  	PermissionsTable = "permissions"
    34  	// PermissionsInverseTable is the table name for the Permission entity.
    35  	// It exists in this package in order to avoid circular dependency with the "permission" package.
    36  	PermissionsInverseTable = "permissions"
    37  	// PermissionsColumn is the table column denoting the permissions relation/edge.
    38  	PermissionsColumn = "role_id"
    39  	// UsersTable is the table that holds the users relation/edge. The primary key declared below.
    40  	UsersTable = "role_users"
    41  	// UsersInverseTable is the table name for the User entity.
    42  	// It exists in this package in order to avoid circular dependency with the "user" package.
    43  	UsersInverseTable = "users"
    44  )
    45  
    46  // Columns holds all SQL columns for role fields.
    47  var Columns = []string{
    48  	FieldID,
    49  	FieldCreatedAt,
    50  	FieldUpdatedAt,
    51  	FieldDeletedAt,
    52  	FieldName,
    53  	FieldDescription,
    54  	FieldRoot,
    55  }
    56  
    57  var (
    58  	// UsersPrimaryKey and UsersColumn2 are the table columns denoting the
    59  	// primary key for the users relation (M2M).
    60  	UsersPrimaryKey = []string{"role_id", "user_id"}
    61  )
    62  
    63  // ValidColumn reports if the column name is valid (part of the table columns).
    64  func ValidColumn(column string) bool {
    65  	for i := range Columns {
    66  		if column == Columns[i] {
    67  			return true
    68  		}
    69  	}
    70  	return false
    71  }
    72  
    73  var (
    74  	// DefaultCreatedAt holds the default value on creation for the "created_at" field.
    75  	DefaultCreatedAt func() time.Time
    76  	// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
    77  	DefaultUpdatedAt func() time.Time
    78  	// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
    79  	UpdateDefaultUpdatedAt func() time.Time
    80  )