mirror of
https://github.com/hay-kot/homebox.git
synced 2024-12-03 05:55:41 +00:00
95ab14b866
* format readme * update logo * format html * add logo to docs * repository for document and document tokens * add attachments type and repository * autogenerate types via scripts * use autogenerated types * attachment type updates * add insured and quantity fields for items * implement HasID interface for entities * implement label updates for items * implement service update method * WIP item update client side actions * check err on attachment * finish types for basic items editor * remove unused var * house keeping
85 lines
2.9 KiB
Go
85 lines
2.9 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package documenttoken
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the documenttoken type in the database.
|
|
Label = "document_token"
|
|
// FieldID holds the string denoting the id field in the database.
|
|
FieldID = "id"
|
|
// 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"
|
|
// FieldToken holds the string denoting the token field in the database.
|
|
FieldToken = "token"
|
|
// FieldUses holds the string denoting the uses field in the database.
|
|
FieldUses = "uses"
|
|
// FieldExpiresAt holds the string denoting the expires_at field in the database.
|
|
FieldExpiresAt = "expires_at"
|
|
// EdgeDocument holds the string denoting the document edge name in mutations.
|
|
EdgeDocument = "document"
|
|
// Table holds the table name of the documenttoken in the database.
|
|
Table = "document_tokens"
|
|
// DocumentTable is the table that holds the document relation/edge.
|
|
DocumentTable = "document_tokens"
|
|
// DocumentInverseTable is the table name for the Document entity.
|
|
// It exists in this package in order to avoid circular dependency with the "document" package.
|
|
DocumentInverseTable = "documents"
|
|
// DocumentColumn is the table column denoting the document relation/edge.
|
|
DocumentColumn = "document_document_tokens"
|
|
)
|
|
|
|
// Columns holds all SQL columns for documenttoken fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldCreatedAt,
|
|
FieldUpdatedAt,
|
|
FieldToken,
|
|
FieldUses,
|
|
FieldExpiresAt,
|
|
}
|
|
|
|
// ForeignKeys holds the SQL foreign-keys that are owned by the "document_tokens"
|
|
// table and are not defined as standalone fields in the schema.
|
|
var ForeignKeys = []string{
|
|
"document_document_tokens",
|
|
}
|
|
|
|
// 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
|
|
// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
|
|
UpdateDefaultUpdatedAt func() time.Time
|
|
// TokenValidator is a validator for the "token" field. It is called by the builders before save.
|
|
TokenValidator func([]byte) error
|
|
// DefaultUses holds the default value on creation for the "uses" field.
|
|
DefaultUses int
|
|
// DefaultExpiresAt holds the default value on creation for the "expires_at" field.
|
|
DefaultExpiresAt func() time.Time
|
|
// DefaultID holds the default value on creation for the "id" field.
|
|
DefaultID func() uuid.UUID
|
|
)
|