You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
2.0 KiB
71 lines
2.0 KiB
// Code generated by entc, DO NOT EDIT.
|
|
|
|
package comment
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the comment type in the database.
|
|
Label = "comment"
|
|
// FieldID holds the string denoting the id field in the database.
|
|
FieldID = "id"
|
|
// FieldName holds the string denoting the name field in the database.
|
|
FieldName = "name"
|
|
// FieldContent holds the string denoting the content field in the database.
|
|
FieldContent = "content"
|
|
// FieldCreatedAt holds the string denoting the created_at field in the database.
|
|
FieldCreatedAt = "created_at"
|
|
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
|
|
FieldUpdatedAt = "updated_at"
|
|
|
|
// EdgePost holds the string denoting the post edge name in mutations.
|
|
EdgePost = "post"
|
|
|
|
// Table holds the table name of the comment in the database.
|
|
Table = "comments"
|
|
// PostTable is the table the holds the post relation/edge.
|
|
PostTable = "comments"
|
|
// PostInverseTable is the table name for the Article entity.
|
|
// It exists in this package in order to avoid circular dependency with the "article" package.
|
|
PostInverseTable = "articles"
|
|
// PostColumn is the table column denoting the post relation/edge.
|
|
PostColumn = "article_comments"
|
|
)
|
|
|
|
// Columns holds all SQL columns for comment fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldName,
|
|
FieldContent,
|
|
FieldCreatedAt,
|
|
FieldUpdatedAt,
|
|
}
|
|
|
|
// ForeignKeys holds the SQL foreign-keys that are owned by the Comment type.
|
|
var ForeignKeys = []string{
|
|
"article_comments",
|
|
}
|
|
|
|
// ValidColumn reports if the column name is valid (part of the table columns).
|
|
func ValidColumn(column string) bool {
|
|
for i := range Columns {
|
|
if column == Columns[i] {
|
|
return true
|
|
}
|
|
}
|
|
for i := range ForeignKeys {
|
|
if column == ForeignKeys[i] {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
var (
|
|
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
|
|
DefaultCreatedAt func() time.Time
|
|
// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
|
|
DefaultUpdatedAt func() time.Time
|
|
)
|
|
|