IAM: Add uid column in team_member DB table (#112439)
* add uid column in team_member DB table * generate openapi
This commit is contained in:
@@ -83,4 +83,17 @@ func addTeamMigrations(mg *Migrator) {
|
||||
Name: "permission", Type: DB_SmallInt, Nullable: true,
|
||||
}))
|
||||
mg.AddMigration("add unique index team_member_user_id_org_id", NewAddIndexMigration(teamMemberV1, teamMemberV1.Indices[3]))
|
||||
|
||||
mg.AddMigration("Add column uid in team_member", NewAddColumnMigration(teamMemberV1, &Column{
|
||||
Name: "uid", Type: DB_NVarchar, Length: 40, Nullable: true,
|
||||
}))
|
||||
|
||||
mg.AddMigration("Update uid column values in team_member", NewRawSQLMigration("").
|
||||
SQLite("UPDATE team_member SET uid=printf('tm%09d',id) WHERE uid IS NULL OR uid = '';").
|
||||
Postgres("UPDATE team_member SET uid='tm' || lpad('' || id::text,9,'0') WHERE uid IS NULL OR uid = '';").
|
||||
Mysql("UPDATE team_member SET uid=concat('tm',lpad(id,9,'0')) WHERE uid IS NULL OR uid = '';"))
|
||||
|
||||
mg.AddMigration("Add unique index team_member_uid", NewAddIndexMigration(teamMemberV1, &Index{
|
||||
Cols: []string{"uid"}, Type: UniqueIndex,
|
||||
}))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user