Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

made the 'version' column primary key to fix #659 #783

Merged
merged 1 commit into from Sep 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion schema_migrations.go
@@ -1,3 +1,4 @@
//go:build !appengine
// +build !appengine

package pop
Expand All @@ -9,7 +10,7 @@ import (
)

func newSchemaMigrations(name string) fizz.Table {
return fizz.Table{
tab := fizz.Table{
Name: name,
Columns: []fizz.Column{
{
Expand All @@ -24,4 +25,9 @@ func newSchemaMigrations(name string) fizz.Table {
{Name: fmt.Sprintf("%s_version_idx", name), Columns: []string{"version"}, Unique: true},
},
}
// this is for https://github.com/gobuffalo/pop/issues/659.
// primary key is not necessary for the migration table but it looks like
// some database engine versions requires it for index.
tab.PrimaryKey("version")
sio4 marked this conversation as resolved.
Show resolved Hide resolved
return tab
}