99 lines
		
	
	
		
			3.2 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			99 lines
		
	
	
		
			3.2 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| // Code generated by ent, DO NOT EDIT.
 | |
| 
 | |
| package card
 | |
| 
 | |
| import (
 | |
| 	"time"
 | |
| )
 | |
| 
 | |
| const (
 | |
| 	// Label holds the string label denoting the card type in the database.
 | |
| 	Label = "card"
 | |
| 	// FieldID holds the string denoting the id field in the database.
 | |
| 	FieldID = "id"
 | |
| 	// FieldPassword holds the string denoting the password field in the database.
 | |
| 	FieldPassword = "password"
 | |
| 	// FieldCard holds the string denoting the card field in the database.
 | |
| 	FieldCard = "card"
 | |
| 	// FieldSkill holds the string denoting the skill field in the database.
 | |
| 	FieldSkill = "skill"
 | |
| 	// FieldStatus holds the string denoting the status field in the database.
 | |
| 	FieldStatus = "status"
 | |
| 	// FieldToken holds the string denoting the token field in the database.
 | |
| 	FieldToken = "token"
 | |
| 	// FieldCp holds the string denoting the cp field in the database.
 | |
| 	FieldCp = "cp"
 | |
| 	// FieldURL holds the string denoting the url field in the database.
 | |
| 	FieldURL = "url"
 | |
| 	// FieldCount holds the string denoting the count field in the database.
 | |
| 	FieldCount = "count"
 | |
| 	// FieldAuthor holds the string denoting the author field in the database.
 | |
| 	FieldAuthor = "author"
 | |
| 	// FieldCreatedAt holds the string denoting the created_at field in the database.
 | |
| 	FieldCreatedAt = "created_at"
 | |
| 	// EdgeOwner holds the string denoting the owner edge name in mutations.
 | |
| 	EdgeOwner = "owner"
 | |
| 	// Table holds the table name of the card in the database.
 | |
| 	Table = "cards"
 | |
| 	// OwnerTable is the table that holds the owner relation/edge.
 | |
| 	OwnerTable = "cards"
 | |
| 	// OwnerInverseTable is the table name for the User entity.
 | |
| 	// It exists in this package in order to avoid circular dependency with the "user" package.
 | |
| 	OwnerInverseTable = "users"
 | |
| 	// OwnerColumn is the table column denoting the owner relation/edge.
 | |
| 	OwnerColumn = "user_card"
 | |
| )
 | |
| 
 | |
| // Columns holds all SQL columns for card fields.
 | |
| var Columns = []string{
 | |
| 	FieldID,
 | |
| 	FieldPassword,
 | |
| 	FieldCard,
 | |
| 	FieldSkill,
 | |
| 	FieldStatus,
 | |
| 	FieldToken,
 | |
| 	FieldCp,
 | |
| 	FieldURL,
 | |
| 	FieldCount,
 | |
| 	FieldAuthor,
 | |
| 	FieldCreatedAt,
 | |
| }
 | |
| 
 | |
| // ForeignKeys holds the SQL foreign-keys that are owned by the "cards"
 | |
| // table and are not defined as standalone fields in the schema.
 | |
| var ForeignKeys = []string{
 | |
| 	"user_card",
 | |
| }
 | |
| 
 | |
| // 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 (
 | |
| 	// PasswordValidator is a validator for the "password" field. It is called by the builders before save.
 | |
| 	PasswordValidator func(string) error
 | |
| 	// DefaultCard holds the default value on creation for the "card" field.
 | |
| 	DefaultCard func() int
 | |
| 	// DefaultSkill holds the default value on creation for the "skill" field.
 | |
| 	DefaultSkill func() string
 | |
| 	// DefaultStatus holds the default value on creation for the "status" field.
 | |
| 	DefaultStatus func() string
 | |
| 	// DefaultCp holds the default value on creation for the "cp" field.
 | |
| 	DefaultCp func() int
 | |
| 	// DefaultURL holds the default value on creation for the "url" field.
 | |
| 	DefaultURL string
 | |
| 	// DefaultCreatedAt holds the default value on creation for the "created_at" field.
 | |
| 	DefaultCreatedAt func() time.Time
 | |
| )
 |