Browse Source

fix #477

pull/690/head
qiantao 4 months ago
committed by yitea
parent
commit
fccdcbbeda
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      cmd/commands/migrate/migrate.go

+ 2
- 2
cmd/commands/migrate/migrate.go View File

@ -198,8 +198,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" || (!strings.EqualFold(defaultStr, "CURRENT_TIMESTAMP") && ! strings.EqualFold(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)
}
}

Loading…
Cancel
Save