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
This commit is contained in:
作芒 2017-10-03 16:43:40 +08:00
parent e90da8f77b
commit 6f393c6af0
1 changed files with 2 additions and 2 deletions

View File

@ -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)
}
}