package migrator

import 

// Index implements gorm.Index interface
type Index struct {
	TableName       string
	NameValue       string
	ColumnList      []string
	PrimaryKeyValue sql.NullBool
	UniqueValue     sql.NullBool
	OptionValue     string
}

// Table return the table name of the index.
func ( Index) () string {
	return .TableName
}

// Name return the name of the index.
func ( Index) () string {
	return .NameValue
}

// Columns return the columns of the index
func ( Index) () []string {
	return .ColumnList
}

// PrimaryKey returns the index is primary key or not.
func ( Index) () ( bool,  bool) {
	return .PrimaryKeyValue.Bool, .PrimaryKeyValue.Valid
}

// Unique returns whether the index is unique or not.
func ( Index) () ( bool,  bool) {
	return .UniqueValue.Bool, .UniqueValue.Valid
}

// Option return the optional attribute of the index
func ( Index) () string {
	return .OptionValue
}