From 1bda5dfdbae6766db17c823544748d8997027ecc Mon Sep 17 00:00:00 2001 From: Svetlin Ralchev Date: Tue, 27 Jul 2021 17:39:09 +0100 Subject: [PATCH] We should use char(14) for migration pk The generated primary key required exactly that length. --- sqlmigr/executor.go | 2 +- sqlmigr/executor_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sqlmigr/executor.go b/sqlmigr/executor.go index e91af84..5976a65 100644 --- a/sqlmigr/executor.go +++ b/sqlmigr/executor.go @@ -31,7 +31,7 @@ func (m *Executor) Setup() error { up := &bytes.Buffer{} fmt.Fprintln(up, "CREATE TABLE IF NOT EXISTS migrations (") - fmt.Fprintln(up, " id CHAR(15) NOT NULL PRIMARY KEY,") + fmt.Fprintln(up, " id CHAR(14) NOT NULL PRIMARY KEY,") fmt.Fprintln(up, " description TEXT NOT NULL,") fmt.Fprintln(up, " created_at TIMESTAMP NOT NULL") fmt.Fprintln(up, ");") diff --git a/sqlmigr/executor_test.go b/sqlmigr/executor_test.go index 12b5f66..9cd682e 100644 --- a/sqlmigr/executor_test.go +++ b/sqlmigr/executor_test.go @@ -54,7 +54,7 @@ var _ = Describe("Executor", func() { up := &bytes.Buffer{} fmt.Fprintln(up, "CREATE TABLE IF NOT EXISTS migrations (") - fmt.Fprintln(up, " id CHAR(15) NOT NULL PRIMARY KEY,") + fmt.Fprintln(up, " id CHAR(14) NOT NULL PRIMARY KEY,") fmt.Fprintln(up, " description TEXT NOT NULL,") fmt.Fprintln(up, " created_at TIMESTAMP NOT NULL") fmt.Fprintln(up, ");")