Skip to content

Commit

Permalink
Use CHAR(15) instead of VARCHAR(15)
Browse files Browse the repository at this point in the history
The primary key has a static length.
  • Loading branch information
iamralch committed Jul 27, 2021
1 parent b3e76d9 commit edeacac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sqlmigr/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ func (m *Executor) Setup() error {
up := &bytes.Buffer{}

fmt.Fprintln(up, "CREATE TABLE IF NOT EXISTS migrations (")
fmt.Fprintln(up, " id VARCHAR(15) NOT NULL PRIMARY KEY,")
fmt.Fprintln(up, " description TEXT NOT NULL,")
fmt.Fprintln(up, " created_at TIMESTAMP NOT NULL")
fmt.Fprintln(up, " id CHAR(15) NOT NULL PRIMARY KEY,")
fmt.Fprintln(up, " description TEXT NOT NULL,")
fmt.Fprintln(up, " created_at TIMESTAMP NOT NULL")
fmt.Fprintln(up, ");")
fmt.Fprintln(up)

Expand Down

0 comments on commit edeacac

Please sign in to comment.