forked from mystiq/dex
9b1a8409f1
Looks like Atlas (the new migration library under Ent) cannot handle precision properly. An issue has been reported to Ent: https://github.com/ent/ent/issues/2454 Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
21 lines
530 B
Go
21 lines
530 B
Go
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{
|
|
dialect.Postgres: "timestamptz",
|
|
dialect.SQLite: "timestamp",
|
|
dialect.MySQL: "datetime(3)",
|
|
}
|