Skip to main content
1-Visitor
September 2, 2020
Solved

How to reset SiteUID

  • September 2, 2020
  • 1 reply
  • 2664 views

I used the createSite Service in Thing: PTC.SCA.SCO.DefaultShiftManager to make shifts.

I made several sites as a test. And I used the delteSite Service to erase sites.
but The site deleted without initialization of 'siteUID'
For example I made four sites.and then I delete 1,2,3,4 siteUID.
After I made new site but I got '5' siteUID I want to get '1' siteUID

I want to know how to reset siteUID. Thank you.

 

 

Best answer by abjain

@JackEom : I tested this scenario. When you delete a site id lets say site id '2' and when you create a new site id it will generate from '3'. The only way is to modify it at the db level.

1 reply

15-Moonstone
September 2, 2020

@JackEom If you have not created shifts and shiftschedule for a site, you can update the site table directly in database for updating its uid. 

However if for a site you have created shifts and shift schedules , then you would get foreign key violation constraint while trying to update in the db.

P.S - Please be careful while manipulating data directly in database.

JackEom1-VisitorAuthor
1-Visitor
September 4, 2020

Thanks for answering.

I have already created shiftschedule and shift. The problem I've said also occurs in shiftschedule and shift.

If I delete uid, is it impossible for deleted uid to be generated?(e.x if I deleted '2' Site UID or ShiftSchedule UID or Shift UID, is it impossible those to be generated?) Is there only a way to modify uid?

abjain15-MoonstoneAnswer
15-Moonstone
September 5, 2020

@JackEom : I tested this scenario. When you delete a site id lets say site id '2' and when you create a new site id it will generate from '3'. The only way is to modify it at the db level.