Skip to content

Commit

Permalink
We should use char(14) for migration pk
Browse files Browse the repository at this point in the history
The generated primary key required exactly that length.
  • Loading branch information
iamralch committed Jul 27, 2021
1 parent cdfc124 commit 1bda5df
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sqlmigr/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, ");")
Expand Down
2 changes: 1 addition & 1 deletion sqlmigr/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, ");")
Expand Down

0 comments on commit 1bda5df

Please sign in to comment.