Using the swArchitect application, it is possible to change the current sequence of an existing Identity attribute


One use case where this would be useful is when data has been migrated into the current database, and the next sequence number needs to continue at the last migrated or imported number. Another case would be when the sequence identifier attribute needs to be changed to another one. In this case, the new sequence should continue at the last value of the previous identifier attribute.


Prerequisites


Note: If the attribute is in use, the current sequence value may change while you are preparing the refactoring. If this may cause a problem (i.e., if there is a chance of overlap between the current sequence in use and the new sequence), it is best to complete the refactoring when there is little or no activity in the server. The tool does not check to prevent duplicate values. 


To start, navigate to the Refactorings tab, and select Set sequence value



Enter the Sequence ID of the attribute in the Sequence id field. If you do not know what this value is, you can view it in the attribute. Find the attribute in the Attributes list. Double-click on the attribute or right-click and select Edit



The Sequence id is displayed in the Edit Attribute type dialog. 



This is the value to enter in the Set sequence value refactoring tool. Once you enter it there, the Current sequence value field will populate automatically. You can click Refresh at any time if you would like to confirm that this value has not changed during your preparation, i.e., a user has generated a new item having this attribute.


Enter the New sequence value. In the above example, the new "last-used value" will be "1000". 


Click Update. The next time a user creates an item of a type that has the attribute, the value assigned will be "1001".