Hi, forum followers
First of all, here it is the platform used:
- CUBA Platform version: 7.2.11
- CUBA Studio plugin version: 15.1-202
- IntelliJ version: CUBA Studio 2020.2
- Sql Server 2008 R2
The problem encountered is the following:
Entities on my project have primary key of UUID type. CRUD operations worked fine on the test environment with Cuba application, without legacy data.
We’ve just migrated legacy application’s data to the new cuba application’s database with SQL Server stored procedures, because data model from one to the other is completely different, achieving the UUID value for every UUID primary key with next PL/SQL commands:
CREATE TABLE #Auxiliar (
id uniqueidentifier,
data datetime)
DECLARE @Auxuuid TABLE (MytempId uniqueidentifier)
ALTER TABLE #Auxiliar ADD CONSTRAINT Axiliar_ID DEFAULT (newsequentialid()) FOR id
........
INSERT INTO #Auxiliar (data) OUTPUT inserted.id INTO @Auxuuid VALUES(SYSDATETIME())
SELECT @uuidinserit = MytempId FROM @Auxuuid
insert into MAGATZEM_UBICACIO(ID,UBICACIO_ID, CREATE_TS, VERSION, MAGATZEM_ID) values(@uuidinserit , @ubicacio, SYSDATETIME(),1, @uuidmag)
Now, when testing new Cuba application with a record insertion, next error appears:
Which is the best way to create UUID primary keys in the data migration process to assure that Cuba application doesn’t assign an UUID value that already exists?. Is there another aspect to have in mind?
Thank you in advance