Hey I have a question about `UUID` usage in ROOM ...
# room
k
Hey I have a question about
UUID
usage in ROOM database with the new built in adapter. We decided to move from
Long
@PrimaryKey
type to
UUID
because of integrity reasons. Now we need to migrate those ids. So when writing a migration we use raw SQL where we lose the ability to use built in converters (AFAIU at least) so we can’t insert it as
String
or something else (cant use the `UUIDUtil`from ROOM too). What would be the suggested way to migrate
Long
ids to
UUID
to use the build in adapter? Maybe someone else encountered a similar issue?
Gave it a more thorough look and it seems that if we write our own UUID generate function in the query, it might work. https://stackoverflow.com/questions/66625085/sqlite-generate-guid-uuid-on-select-into-statement
499 Views