How to resolve conflict id objects databases between mobile and server?

The problem is this. The chief wants to gash the offline version mob. app, so you can create objects offline, and when you see the Internet, send it to the online database. What if the server already has the object with that id? How best to solve the problem without touching the server?
P. S mob. option base - Realm, and the server for SQL
July 9th 19 at 10:23
5 answers
July 9th 19 at 10:25
Mobilid to use our database on the server in a separate field.
Or - don't give your ID at all.
After the transfer to the server you want to synchronize with the server ID.
July 9th 19 at 10:27
When you synchronize, remove all mobile phones and more local database again with the remote ID. And when you import the database is a mess ignore ID.
I don't quite understand that have given the "ignore ID" - winnifred_Kreiger commented on July 9th 19 at 10:30
: Your server comes in the packet data with the mobile application, you they are added to the database, but without ID, respectively, on the server they are other. Then just delete all records from mobile applications and work with remote (to request again or poolname, don't know how your app) - aniya.Kertzmann65 commented on July 9th 19 at 10:33
: don't use client ID on the server and generate a new - Lonzo.Johnston commented on July 9th 19 at 10:36
July 9th 19 at 10:29
Use Guidы?
July 9th 19 at 10:31
Make objects locally to transfer them to the server in the "sump" from which the lupa they will be added to the basic system...
July 9th 19 at 10:33
pk mobile and server is different pk is important, and then already on the objectives and structure of the database

Find more questions by tags AndroidMySQLSQL