Skip to content

Commit

Permalink
added conditional for user_roles
Browse files Browse the repository at this point in the history
  • Loading branch information
elraphty committed Apr 22, 2024
1 parent f317d8c commit 4ecd700
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion db/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ func (db database) MigrateTablesWithOrgUuid() {
}
}
if !db.db.Migrator().HasTable("workspace_user_roles") {
db.db.AutoMigrate(&UserRoles{})
if !db.db.Migrator().HasColumn(UserRoles{}, "workspace_uuid") {
db.db.AutoMigrate(&UserRoles{})
}
}
if !db.db.Migrator().HasTable("workspaces") {
db.db.AutoMigrate(&Organization{})
Expand Down

0 comments on commit 4ecd700

Please sign in to comment.