// Code generated by ent, DO NOT EDIT.

package migrate

import (
	"entgo.io/ent/dialect/entsql"
	"entgo.io/ent/dialect/sql/schema"
	"entgo.io/ent/schema/field"
)

var (
	// CategorieColumns holds the columns for the "categorie" table.
	CategorieColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "nom", Type: field.TypeString},
		{Name: "slug", Type: field.TypeString, Nullable: true},
		{Name: "icone", Type: field.TypeString, Nullable: true},
		{Name: "created_at", Type: field.TypeTime},
		{Name: "updated_at", Type: field.TypeTime},
		{Name: "parent_id", Type: field.TypeUUID, Nullable: true},
	}
	// CategorieTable holds the schema information for the "categorie" table.
	CategorieTable = &schema.Table{
		Name:       "categorie",
		Columns:    CategorieColumns,
		PrimaryKey: []*schema.Column{CategorieColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "categorie_categorie_enfants",
				Columns:    []*schema.Column{CategorieColumns[6]},
				RefColumns: []*schema.Column{CategorieColumns[0]},
				OnDelete:   schema.SetNull,
			},
		},
	}
	// ChampPersonnaliseColumns holds the columns for the "champ_personnalise" table.
	ChampPersonnaliseColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "nom_champ", Type: field.TypeString},
		{Name: "type_champ", Type: field.TypeEnum, Enums: []string{"string", "int", "bool", "date"}, Default: "string"},
		{Name: "valeur", Type: field.TypeString, Nullable: true},
		{Name: "unite", Type: field.TypeString, Nullable: true},
		{Name: "created_at", Type: field.TypeTime},
		{Name: "updated_at", Type: field.TypeTime},
		{Name: "objet_id", Type: field.TypeUUID},
	}
	// ChampPersonnaliseTable holds the schema information for the "champ_personnalise" table.
	ChampPersonnaliseTable = &schema.Table{
		Name:       "champ_personnalise",
		Columns:    ChampPersonnaliseColumns,
		PrimaryKey: []*schema.Column{ChampPersonnaliseColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "champ_personnalise_objet_champs_personnalises",
				Columns:    []*schema.Column{ChampPersonnaliseColumns[7]},
				RefColumns: []*schema.Column{ObjetColumns[0]},
				OnDelete:   schema.NoAction,
			},
		},
	}
	// EmplacementColumns holds the columns for the "emplacement" table.
	EmplacementColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "nom", Type: field.TypeString},
		{Name: "slug", Type: field.TypeString, Nullable: true},
		{Name: "piece", Type: field.TypeString, Nullable: true},
		{Name: "meuble", Type: field.TypeString, Nullable: true},
		{Name: "numero_boite", Type: field.TypeString, Nullable: true},
		{Name: "icone", Type: field.TypeString, Nullable: true},
		{Name: "created_at", Type: field.TypeTime},
		{Name: "updated_at", Type: field.TypeTime},
		{Name: "parent_id", Type: field.TypeUUID, Nullable: true},
	}
	// EmplacementTable holds the schema information for the "emplacement" table.
	EmplacementTable = &schema.Table{
		Name:       "emplacement",
		Columns:    EmplacementColumns,
		PrimaryKey: []*schema.Column{EmplacementColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "emplacement_emplacement_enfants",
				Columns:    []*schema.Column{EmplacementColumns[9]},
				RefColumns: []*schema.Column{EmplacementColumns[0]},
				OnDelete:   schema.SetNull,
			},
		},
	}
	// LienObjetEmplacementColumns holds the columns for the "lien_objet_emplacement" table.
	LienObjetEmplacementColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "type", Type: field.TypeEnum, Enums: []string{"stocke", "utilise_dans"}, Default: "stocke"},
		{Name: "created_at", Type: field.TypeTime},
		{Name: "updated_at", Type: field.TypeTime},
		{Name: "emplacement_id", Type: field.TypeUUID},
		{Name: "objet_id", Type: field.TypeUUID},
	}
	// LienObjetEmplacementTable holds the schema information for the "lien_objet_emplacement" table.
	LienObjetEmplacementTable = &schema.Table{
		Name:       "lien_objet_emplacement",
		Columns:    LienObjetEmplacementColumns,
		PrimaryKey: []*schema.Column{LienObjetEmplacementColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "lien_objet_emplacement_emplacement_liens_objets",
				Columns:    []*schema.Column{LienObjetEmplacementColumns[4]},
				RefColumns: []*schema.Column{EmplacementColumns[0]},
				OnDelete:   schema.NoAction,
			},
			{
				Symbol:     "lien_objet_emplacement_objet_liens_emplacements",
				Columns:    []*schema.Column{LienObjetEmplacementColumns[5]},
				RefColumns: []*schema.Column{ObjetColumns[0]},
				OnDelete:   schema.NoAction,
			},
		},
	}
	// ObjetColumns holds the columns for the "objet" table.
	ObjetColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "nom", Type: field.TypeString},
		{Name: "description", Type: field.TypeString, Nullable: true},
		{Name: "quantite", Type: field.TypeInt, Default: 0},
		{Name: "prix_achat", Type: field.TypeFloat64, Nullable: true},
		{Name: "date_achat", Type: field.TypeTime, Nullable: true},
		{Name: "boutique", Type: field.TypeString, Nullable: true},
		{Name: "numero_serie", Type: field.TypeString, Nullable: true},
		{Name: "numero_modele", Type: field.TypeString, Nullable: true},
		{Name: "fabricant", Type: field.TypeString, Nullable: true},
		{Name: "statut", Type: field.TypeEnum, Enums: []string{"en_stock", "pret", "hors_service", "archive"}, Default: "en_stock"},
		{Name: "caracteristiques", Type: field.TypeJSON, Nullable: true},
		{Name: "created_at", Type: field.TypeTime},
		{Name: "updated_at", Type: field.TypeTime},
	}
	// ObjetTable holds the schema information for the "objet" table.
	ObjetTable = &schema.Table{
		Name:       "objet",
		Columns:    ObjetColumns,
		PrimaryKey: []*schema.Column{ObjetColumns[0]},
	}
	// PieceJointeColumns holds the columns for the "piece_jointe" table.
	PieceJointeColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "nom_fichier", Type: field.TypeString},
		{Name: "chemin", Type: field.TypeString},
		{Name: "type_mime", Type: field.TypeString},
		{Name: "est_principale", Type: field.TypeBool, Default: false},
		{Name: "categorie", Type: field.TypeEnum, Enums: []string{"image", "pdf_notice", "markdown_tuto"}, Default: "image"},
		{Name: "created_at", Type: field.TypeTime},
		{Name: "updated_at", Type: field.TypeTime},
		{Name: "objet_id", Type: field.TypeUUID},
	}
	// PieceJointeTable holds the schema information for the "piece_jointe" table.
	PieceJointeTable = &schema.Table{
		Name:       "piece_jointe",
		Columns:    PieceJointeColumns,
		PrimaryKey: []*schema.Column{PieceJointeColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "piece_jointe_objet_pieces_jointes",
				Columns:    []*schema.Column{PieceJointeColumns[8]},
				RefColumns: []*schema.Column{ObjetColumns[0]},
				OnDelete:   schema.NoAction,
			},
		},
	}
	// Tables holds all the tables in the schema.
	Tables = []*schema.Table{
		CategorieTable,
		ChampPersonnaliseTable,
		EmplacementTable,
		LienObjetEmplacementTable,
		ObjetTable,
		PieceJointeTable,
	}
)

func init() {
	CategorieTable.ForeignKeys[0].RefTable = CategorieTable
	CategorieTable.Annotation = &entsql.Annotation{
		Table: "categorie",
	}
	ChampPersonnaliseTable.ForeignKeys[0].RefTable = ObjetTable
	ChampPersonnaliseTable.Annotation = &entsql.Annotation{
		Table: "champ_personnalise",
	}
	EmplacementTable.ForeignKeys[0].RefTable = EmplacementTable
	EmplacementTable.Annotation = &entsql.Annotation{
		Table: "emplacement",
	}
	LienObjetEmplacementTable.ForeignKeys[0].RefTable = EmplacementTable
	LienObjetEmplacementTable.ForeignKeys[1].RefTable = ObjetTable
	LienObjetEmplacementTable.Annotation = &entsql.Annotation{
		Table: "lien_objet_emplacement",
	}
	ObjetTable.Annotation = &entsql.Annotation{
		Table: "objet",
	}
	PieceJointeTable.ForeignKeys[0].RefTable = ObjetTable
	PieceJointeTable.Annotation = &entsql.Annotation{
		Table: "piece_jointe",
	}
}
