package schema

import (
	"entgo.io/ent"
	"entgo.io/ent/schema/edge"
	"entgo.io/ent/schema/field"
	"time"
)

// Project holds the schema definition for the Project entity.
type Project struct {
	ent.Schema
}

// Fields of the Project.
func (Project) Fields() []ent.Field {
	return []ent.Field{
		field.Int("id"),
		field.Time("create_time").Default(time.Now).Immutable(),
		field.String("user"),
		field.String("group"),
		field.String("root_path"),
		field.String("service_name"),
		field.String("binary_path"),
		field.Bool("move_to_target").Default(false),
		field.String("binary_target_path").Optional(),
	}
}

// Edges of the Project.
func (Project) Edges() []ent.Edge {
	return []ent.Edge{
		edge.To("logentries", Logentry.Type),
	}
}
