2021-09-13 19:18:02 +05:30
|
|
|
package schema
|
|
|
|
|
|
|
|
import (
|
|
|
|
"entgo.io/ent/dialect"
|
|
|
|
)
|
|
|
|
|
|
|
|
var textSchema = map[string]string{
|
|
|
|
dialect.Postgres: "text",
|
|
|
|
dialect.SQLite: "text",
|
|
|
|
// MySQL doesn't support indices on text fields w/o
|
|
|
|
// specifying key length. Use varchar instead (767 byte
|
|
|
|
// is the max key length for InnoDB with 4k pages).
|
|
|
|
// For compound indexes (with two keys) even less.
|
|
|
|
dialect.MySQL: "varchar(384)",
|
|
|
|
}
|
|
|
|
|
|
|
|
var timeSchema = map[string]string{
|
2022-03-07 15:58:32 +05:30
|
|
|
dialect.Postgres: "timestamptz(3)",
|
2021-09-13 19:18:02 +05:30
|
|
|
dialect.SQLite: "timestamp",
|
|
|
|
dialect.MySQL: "datetime(3)",
|
|
|
|
}
|