20 lines
478 B
Go
20 lines
478 B
Go
package schema
|
|
|
|
type IndexOrigin string
|
|
|
|
const (
|
|
IndexOriginCreateIndex = IndexOrigin("c")
|
|
IndexOriginUniqueConstraint = IndexOrigin("u")
|
|
IndexOriginPrimaryKey = IndexOrigin("pk")
|
|
)
|
|
|
|
type Index struct {
|
|
Name string `db:"index_name"`
|
|
TableName string `db:"table_name"`
|
|
Columns []string
|
|
IsUnique bool `db:"is_unique"`
|
|
Origin IndexOrigin `db:"origin"`
|
|
// TODO: `where ...` for partial indexes
|
|
// TODO: identify columns that are expressions
|
|
}
|