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

refactor: distinguish between Unique and UniqueIndex #6386

Merged
merged 20 commits into from
Feb 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix format lint
black-06 committed Jun 27, 2023
commit fe3d826b30d452b3f628a0770771fc5b60af7f4c
3 changes: 2 additions & 1 deletion schema/relationship.go
Original file line number Diff line number Diff line change
@@ -590,11 +590,12 @@ func (constraint *Constraint) Build() (sql string, vars []interface{}) {
sql += " ON UPDATE " + constraint.OnUpdate
}

var foreignKeys, references []interface{}
foreignKeys := make([]interface{}, 0, len(constraint.ForeignKeys))
for _, field := range constraint.ForeignKeys {
foreignKeys = append(foreignKeys, clause.Column{Name: field.DBName})
}

references := make([]interface{}, 0, len(constraint.References))
for _, field := range constraint.References {
references = append(references, clause.Column{Name: field.DBName})
}