Here's a possible approach to automating, but it depends last question.
If you change a longint to an alpha field, the new new alpha field retains the 
longint value.
You could send the modified Structure with the longint fields changed to alpha.
When the Structure sees that a Datafile is not converted, for each related 
field it 
  remembers the longint value in the One Table's field
  creates and saves a UUID for the One Table's field
  queries the related using the old longint value
  changes the Many table's link field to the One Table's UUID.
  set the relations and Primary Keys*

Eventually marks the datafile as converted.

*Can SQL be used to set a Primary Key for a table that has none?

Keith - CDI

> On Oct 24, 2018, at 9:52 AM, Two Way Communications via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> I have an application with a big database file ( + 60 GB), with 128 tables. 
> (4D v17)
> 
> All id fields and foreign keys are of type longint. 
> 
> Now, for replication and sharing purposes, I would like to change the type to 
> UID.
> 
> The process seems quite cumbersome: to start, I need to remove the ‘primary 
> key’ flag from all the ID fields, then I need to add UID fields to every 
> table, 
> change the foreign keys as well, and use apply formula to make sure the 
> relations are intact. I am a bit worried that this will have a major impact 
> on the size of the data file.
> 
> Furthermore, I need to automate the whole process so the upgrade works 
> flawlessly at the customers site.
> 
> Has anyone ever done this?
> Any tips?
> 
> Regards,
> 
> Rudy Mortier
> Two Way Communications bvba 
 
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to