S
S
Sarrius2016-05-29 14:22:27
MySQL
Sarrius, 2016-05-29 14:22:27

How to resolve database object id conflict between mobile and server?

The problem is this. The boss wants to file an offline version of the mob. applications so that you can create an object offline, and when the Internet appears, send it to the online database. What if the server already has an object with the same id? How to solve the problem as painlessly as possible without touching the server?
PS mob. base option - Realm, and the server in SQL

Answer the question

In order to leave comments, you need to log in

5 answer(s)
R
res2001, 2016-05-29
@sarrius

Для mobilid используйте в базе на сервере отдельное поле.
Либо - не передавайте ID вовсе.
После передачи на сервер, нужно синхронизировать ID с сервером.

A
Anatoly, 2016-05-29
@taliban

When synchronizing, delete everything from the mobile and fill in the local database again with the deleted IDs. And when importing a mobile database, ignore the ID.

M
Maxim Khodyrev, 2016-05-29
@maximkou

Use Guides ?

V
Voll., 2016-05-29
@vollthegreat

Make objects locally, transfer them to the server to the "sump" from which they will be added to the main system with a loop ...

O
Oleg Gamega, 2016-05-29
@gadfi

pk mobile and server are different pk, this is the main thing, and then from the task and the structure of the database

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question