From 6f393c6af07044aec6921433d0bc4a83d03b3df2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=9C=E8=8A=92?= Date: Tue, 3 Oct 2017 16:43:40 +0800 Subject: [PATCH] compatible with MariaDB version 10.2.9 MariaDB will show "current_timestamp()" instead of MySQL's "current_timestamp" Bee should work well with both of those --- cmd/commands/migrate/migrate.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/commands/migrate/migrate.go b/cmd/commands/migrate/migrate.go index 1870945..83bfe0a 100644 --- a/cmd/commands/migrate/migrate.go +++ b/cmd/commands/migrate/migrate.go @@ -187,8 +187,8 @@ func checkForSchemaUpdateTable(db *sql.DB, driver string) { beeLogger.Log.Fatalf("Column migration.name type mismatch: TYPE: %s, NULL: %s", typeStr, nullStr) } } else if fieldStr == "created_at" { - if typeStr != "timestamp" || defaultStr != "CURRENT_TIMESTAMP" { - beeLogger.Log.Hint("Expecting TYPE: timestamp, DEFAULT: CURRENT_TIMESTAMP") + if typeStr != "timestamp" || (defaultStr != "CURRENT_TIMESTAMP" && defaultStr != "CURRENT_TIMESTAMP()") { + beeLogger.Log.Hint("Expecting TYPE: timestamp, DEFAULT: CURRENT_TIMESTAMP || CURRENT_TIMESTAMP()") beeLogger.Log.Fatalf("Column migration.timestamp type mismatch: TYPE: %s, DEFAULT: %s", typeStr, defaultStr) } }