revert: atlas and precision change

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>
This commit is contained in:
Mark Sagi-Kazar 2022-04-06 14:18:32 +02:00
parent b51e73bc2e
commit 9b1a8409f1
No known key found for this signature in database
GPG Key ID: 31AB0439F4C5C90E
4 changed files with 4 additions and 4 deletions

View File

@ -57,7 +57,7 @@ func (m *MySQL) Open(logger log.Logger) (storage.Storage, error) {
client.WithTxIsolationLevel(sql.LevelSerializable), client.WithTxIsolationLevel(sql.LevelSerializable),
) )
if err := databaseClient.Schema().Create(context.TODO(), schema.WithAtlas(true)); err != nil { if err := databaseClient.Schema().Create(context.TODO(), schema.WithAtlas(false)); err != nil {
return nil, err return nil, err
} }

View File

@ -57,7 +57,7 @@ func (p *Postgres) Open(logger log.Logger) (storage.Storage, error) {
client.WithTxIsolationLevel(sql.LevelSerializable), client.WithTxIsolationLevel(sql.LevelSerializable),
) )
if err := databaseClient.Schema().Create(context.TODO(), schema.WithAtlas(true)); err != nil { if err := databaseClient.Schema().Create(context.TODO(), schema.WithAtlas(false)); err != nil {
return nil, err return nil, err
} }

View File

@ -15,7 +15,7 @@ var textSchema = map[string]string{
} }
var timeSchema = map[string]string{ var timeSchema = map[string]string{
dialect.Postgres: "timestamptz(3)", dialect.Postgres: "timestamptz",
dialect.SQLite: "timestamp", dialect.SQLite: "timestamp",
dialect.MySQL: "datetime(3)", dialect.MySQL: "datetime(3)",
} }

View File

@ -44,7 +44,7 @@ func (s *SQLite3) Open(logger log.Logger) (storage.Storage, error) {
client.WithHasher(sha256.New), client.WithHasher(sha256.New),
) )
if err := databaseClient.Schema().Create(context.TODO(), schema.WithAtlas(true)); err != nil { if err := databaseClient.Schema().Create(context.TODO(), schema.WithAtlas(false)); err != nil {
return nil, err return nil, err
} }