mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-23 12:30:41 +01:00
feat(backup): add random suffix for resources with the same name
This commit is contained in:
parent
813358b266
commit
d173577f3d
@ -88,11 +88,29 @@ func (b *BackupDB) makeUniqueNames() {
|
||||
item.Name = name
|
||||
})
|
||||
|
||||
makeUniqueNames(b.inventories, func(item *db.Inventory) string {
|
||||
return item.Name
|
||||
}, func(item *db.Inventory, name string) {
|
||||
item.Name = name
|
||||
})
|
||||
|
||||
makeUniqueNames(b.environments, func(item *db.Environment) string {
|
||||
return item.Name
|
||||
}, func(item *db.Environment, name string) {
|
||||
item.Name = name
|
||||
})
|
||||
|
||||
makeUniqueNames(b.keys, func(item *db.AccessKey) string {
|
||||
return item.Name
|
||||
}, func(item *db.AccessKey, name string) {
|
||||
item.Name = name
|
||||
})
|
||||
|
||||
makeUniqueNames(b.views, func(item *db.View) string {
|
||||
return item.Title
|
||||
}, func(item *db.View, name string) {
|
||||
item.Title = name
|
||||
})
|
||||
}
|
||||
|
||||
func (b *BackupDB) new(projectID int, store db.Store) (*BackupDB, error) {
|
||||
|
Loading…
Reference in New Issue
Block a user