From 16769960cea36148a8ad57c0e85301faebb5f98d Mon Sep 17 00:00:00 2001 From: "John K. Luebs" Date: Mon, 17 Mar 2014 18:12:53 -0400 Subject: [PATCH] Replace TEXT type with TIMESTAMP in sqlite migration table Although TIMESTAMP specifies NUMERIC affinity, since datetime() is a string the actual type will always be TEXT. sqlite never enforces type, so this is a non-issue. As documented here: https://github.com/mattn/go-sqlite3/issues/42 the column must be TIMESTAMP for Time type scan. --- lib/goose/dialect.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/goose/dialect.go b/lib/goose/dialect.go index a9cdf21..75d86a5 100644 --- a/lib/goose/dialect.go +++ b/lib/goose/dialect.go @@ -104,7 +104,7 @@ func (m *Sqlite3Dialect) createVersionTableSql() string { id INTEGER PRIMARY KEY AUTOINCREMENT, version_id INTEGER NOT NULL, is_applied INTEGER NOT NULL, - tstamp TEXT DEFAULT (datetime('now')) + tstamp TIMESTAMP DEFAULT (datetime('now')) );` }