// Code generated by ent, DO NOT EDIT.

package migrate

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

var (
	// CoursesColumns holds the columns for the "courses" table.
	CoursesColumns = []*schema.Column{
		{Name: "id", Type: field.TypeInt, Increment: true},
		{Name: "title", Type: field.TypeString},
		{Name: "department_courses", Type: field.TypeInt},
	}
	// CoursesTable holds the schema information for the "courses" table.
	CoursesTable = &schema.Table{
		Name:       "courses",
		Columns:    CoursesColumns,
		PrimaryKey: []*schema.Column{CoursesColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "courses_departments_courses",
				Columns:    []*schema.Column{CoursesColumns[2]},
				RefColumns: []*schema.Column{DepartmentsColumns[0]},
				OnDelete:   schema.NoAction,
			},
		},
	}
	// DepartmentsColumns holds the columns for the "departments" table.
	DepartmentsColumns = []*schema.Column{
		{Name: "id", Type: field.TypeInt, Increment: true},
		{Name: "name", Type: field.TypeString},
	}
	// DepartmentsTable holds the schema information for the "departments" table.
	DepartmentsTable = &schema.Table{
		Name:       "departments",
		Columns:    DepartmentsColumns,
		PrimaryKey: []*schema.Column{DepartmentsColumns[0]},
	}
	// EnrollmentsColumns holds the columns for the "enrollments" table.
	EnrollmentsColumns = []*schema.Column{
		{Name: "id", Type: field.TypeInt, Increment: true},
		{Name: "semester", Type: field.TypeString},
		{Name: "year", Type: field.TypeInt},
		{Name: "course_enrollments", Type: field.TypeInt},
		{Name: "student_enrollments", Type: field.TypeInt},
	}
	// EnrollmentsTable holds the schema information for the "enrollments" table.
	EnrollmentsTable = &schema.Table{
		Name:       "enrollments",
		Columns:    EnrollmentsColumns,
		PrimaryKey: []*schema.Column{EnrollmentsColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "enrollments_courses_enrollments",
				Columns:    []*schema.Column{EnrollmentsColumns[3]},
				RefColumns: []*schema.Column{CoursesColumns[0]},
				OnDelete:   schema.NoAction,
			},
			{
				Symbol:     "enrollments_students_enrollments",
				Columns:    []*schema.Column{EnrollmentsColumns[4]},
				RefColumns: []*schema.Column{StudentsColumns[0]},
				OnDelete:   schema.NoAction,
			},
		},
	}
	// InstructorsColumns holds the columns for the "instructors" table.
	InstructorsColumns = []*schema.Column{
		{Name: "id", Type: field.TypeInt, Increment: true},
		{Name: "name", Type: field.TypeString},
		{Name: "department_instructors", Type: field.TypeInt},
	}
	// InstructorsTable holds the schema information for the "instructors" table.
	InstructorsTable = &schema.Table{
		Name:       "instructors",
		Columns:    InstructorsColumns,
		PrimaryKey: []*schema.Column{InstructorsColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "instructors_departments_instructors",
				Columns:    []*schema.Column{InstructorsColumns[2]},
				RefColumns: []*schema.Column{DepartmentsColumns[0]},
				OnDelete:   schema.NoAction,
			},
		},
	}
	// StudentsColumns holds the columns for the "students" table.
	StudentsColumns = []*schema.Column{
		{Name: "id", Type: field.TypeInt, Increment: true},
		{Name: "name", Type: field.TypeString},
		{Name: "department_students", Type: field.TypeInt},
	}
	// StudentsTable holds the schema information for the "students" table.
	StudentsTable = &schema.Table{
		Name:       "students",
		Columns:    StudentsColumns,
		PrimaryKey: []*schema.Column{StudentsColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "students_departments_students",
				Columns:    []*schema.Column{StudentsColumns[2]},
				RefColumns: []*schema.Column{DepartmentsColumns[0]},
				OnDelete:   schema.NoAction,
			},
		},
	}
	// Tables holds all the tables in the schema.
	Tables = []*schema.Table{
		CoursesTable,
		DepartmentsTable,
		EnrollmentsTable,
		InstructorsTable,
		StudentsTable,
	}
)

func init() {
	CoursesTable.ForeignKeys[0].RefTable = DepartmentsTable
	EnrollmentsTable.ForeignKeys[0].RefTable = CoursesTable
	EnrollmentsTable.ForeignKeys[1].RefTable = StudentsTable
	InstructorsTable.ForeignKeys[0].RefTable = DepartmentsTable
	StudentsTable.ForeignKeys[0].RefTable = DepartmentsTable
}
