// Code generated by entc, DO NOT EDIT.

package tag

import (
	"time"
)

const (
	// Label holds the string label denoting the tag type in the database.
	Label = "tag"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldSlug holds the string denoting the slug field in the database.
	FieldSlug = "slug"
	// FieldName holds the string denoting the name field in the database.
	FieldName = "name"
	// 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"

	// EdgePosts holds the string denoting the posts edge name in mutations.
	EdgePosts = "posts"

	// Table holds the table name of the tag in the database.
	Table = "tags"
	// PostsTable is the table the holds the posts relation/edge. The primary key declared below.
	PostsTable = "tag_posts"
	// PostsInverseTable is the table name for the Article entity.
	// It exists in this package in order to avoid circular dependency with the "article" package.
	PostsInverseTable = "articles"
)

// Columns holds all SQL columns for tag fields.
var Columns = []string{
	FieldID,
	FieldSlug,
	FieldName,
	FieldCreatedAt,
	FieldUpdatedAt,
}

var (
	// PostsPrimaryKey and PostsColumn2 are the table columns denoting the
	// primary key for the posts relation (M2M).
	PostsPrimaryKey = []string{"tag_id", "article_id"}
)

// 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
		}
	}
	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
)
