Skip to content

Commit

Permalink
made UserROles migration conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
elraphty committed Apr 22, 2024
1 parent 326d13e commit 6d0e70c
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 @@ -67,13 +67,15 @@ func InitDB() {
db.AutoMigrate(&ConnectionCodes{})
db.AutoMigrate(&Bounty{})
db.AutoMigrate(&BountyRoles{})
db.AutoMigrate(&UserRoles{})
db.AutoMigrate(&BountyBudget{})
db.AutoMigrate(&BudgetHistory{})
db.AutoMigrate(&PaymentHistory{})
db.AutoMigrate(&InvoiceList{})
db.AutoMigrate(&UserInvoiceData{})

if !db.Migrator().HasTable("workspace_user_roles") {
db.AutoMigrate(&UserRoles{})
}
if !db.Migrator().HasTable("workspaces") {
db.AutoMigrate(&Organization{})
}
Expand Down

0 comments on commit 6d0e70c

Please sign in to comment.