Skip to content

Commit

Permalink
Fix version field size in migrations table (#321)
Browse files Browse the repository at this point in the history
This will prevent big indexes for nothing.
  • Loading branch information
stanislas-m authored Nov 28, 2018
1 parent 5aaa4ca commit ca53d96
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion schema_migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ func newSchemaMigrations(name string) fizz.Table {
return fizz.Table{
Name: name,
Columns: []fizz.Column{
{Name: "version", ColType: "string"},
{
Name: "version",
ColType: "string",
Options: map[string]interface{}{
"size": 14, // len(YYYYMMDDhhmmss)
},
},
},
Indexes: []fizz.Index{
{Name: fmt.Sprintf("%s_version_idx", name), Columns: []string{"version"}, Unique: true},
Expand Down
8 changes: 7 additions & 1 deletion schema_migrations_appengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ func newSchemaMigrations(name string) fizz.Table {
return fizz.Table{
Name: name,
Columns: []fizz.Column{
{Name: "version", ColType: "string"},
{
Name: "version",
ColType: "string",
Options: map[string]interface{}{
"size": 14, // len(YYYYMMDDhhmmss)
},
},
},
Indexes: []fizz.Index{},
}
Expand Down

0 comments on commit ca53d96

Please sign in to comment.