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

     1  // Code generated by entc, DO NOT EDIT.
     2  
     3  package comment
     4  
     5  import (
     6  	"time"
     7  )
     8  
     9  const (
    10  	// Label holds the string label denoting the comment type in the database.
    11  	Label = "comment"
    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  	// FieldContent holds the string denoting the content field in the database.
    21  	FieldContent = "content"
    22  	// FieldContentHTML holds the string denoting the content_html field in the database.
    23  	FieldContentHTML = "content_html"
    24  	// FieldVotes holds the string denoting the votes field in the database.
    25  	FieldVotes = "votes"
    26  	// FieldPostID holds the string denoting the post_id field in the database.
    27  	FieldPostID = "post_id"
    28  	// FieldUserID holds the string denoting the user_id field in the database.
    29  	FieldUserID = "user_id"
    30  	// FieldParentID holds the string denoting the parent_id field in the database.
    31  	FieldParentID = "parent_id"
    32  	// EdgePost holds the string denoting the post edge name in mutations.
    33  	EdgePost = "post"
    34  	// EdgeUser holds the string denoting the user edge name in mutations.
    35  	EdgeUser = "user"
    36  	// EdgeChildren holds the string denoting the children edge name in mutations.
    37  	EdgeChildren = "children"
    38  	// EdgeParent holds the string denoting the parent edge name in mutations.
    39  	EdgeParent = "parent"
    40  	// Table holds the table name of the comment in the database.
    41  	Table = "comments"
    42  	// PostTable is the table that holds the post relation/edge.
    43  	PostTable = "comments"
    44  	// PostInverseTable is the table name for the Post entity.
    45  	// It exists in this package in order to avoid circular dependency with the "post" package.
    46  	PostInverseTable = "posts"
    47  	// PostColumn is the table column denoting the post relation/edge.
    48  	PostColumn = "post_id"
    49  	// UserTable is the table that holds the user relation/edge.
    50  	UserTable = "comments"
    51  	// UserInverseTable is the table name for the User entity.
    52  	// It exists in this package in order to avoid circular dependency with the "user" package.
    53  	UserInverseTable = "users"
    54  	// UserColumn is the table column denoting the user relation/edge.
    55  	UserColumn = "user_id"
    56  	// ChildrenTable is the table that holds the children relation/edge.
    57  	ChildrenTable = "comments"
    58  	// ChildrenColumn is the table column denoting the children relation/edge.
    59  	ChildrenColumn = "parent_id"
    60  	// ParentTable is the table that holds the parent relation/edge.
    61  	ParentTable = "comments"
    62  	// ParentColumn is the table column denoting the parent relation/edge.
    63  	ParentColumn = "parent_id"
    64  )
    65  
    66  // Columns holds all SQL columns for comment fields.
    67  var Columns = []string{
    68  	FieldID,
    69  	FieldCreatedAt,
    70  	FieldUpdatedAt,
    71  	FieldDeletedAt,
    72  	FieldContent,
    73  	FieldContentHTML,
    74  	FieldVotes,
    75  	FieldPostID,
    76  	FieldUserID,
    77  	FieldParentID,
    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  	return false
    88  }
    89  
    90  var (
    91  	// DefaultCreatedAt holds the default value on creation for the "created_at" field.
    92  	DefaultCreatedAt func() time.Time
    93  	// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
    94  	DefaultUpdatedAt func() time.Time
    95  	// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
    96  	UpdateDefaultUpdatedAt func() time.Time
    97  	// DefaultVotes holds the default value on creation for the "votes" field.
    98  	DefaultVotes int64
    99  )