add team_member index on user_id org_id (#91819)

This pr adds a composite index on on the team_member table on user_id and org_id
This commit is contained in:
Jeff Levin 2024-08-13 02:58:00 -08:00 committed by GitHub
parent b2eeb0dd6e
commit 8961f392f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -51,6 +51,7 @@ func addTeamMigrations(mg *Migrator) {
{Cols: []string{"org_id"}},
{Cols: []string{"org_id", "team_id", "user_id"}, Type: UniqueIndex},
{Cols: []string{"team_id"}},
{Cols: []string{"user_id", "org_id"}},
},
}
@ -73,4 +74,5 @@ func addTeamMigrations(mg *Migrator) {
mg.AddMigration("Add column permission to team_member table", NewAddColumnMigration(teamMemberV1, &Column{
Name: "permission", Type: DB_SmallInt, Nullable: true,
}))
mg.AddMigration("add unique index team_member_user_id_org_id", NewAddIndexMigration(teamMemberV1, teamMemberV1.Indices[3]))
}