Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recommendation: Integrating brick into existing supabase project. #545

Open
SebastianKlaiber opened this issue Feb 20, 2025 · 1 comment

Comments

@SebastianKlaiber
Copy link

If I understand it correctly, then an ID based on UUID is recommended for brick to check which entries need to be synced with Supabase. Do you have any recommendation how to migrate from an INT based ID to a UUID based ID without breaking the existing apps?

@tshedor
Copy link
Collaborator

tshedor commented Feb 21, 2025

@SebastianKlaiber

  1. Add a non-null UUID column to all tables. The default value should be a generated UUID (gen_random_uuid())
  2. In Dart, specify both fields. Annotate both with @Sqlite(index: true, unique: true) and @Supabase(unique: true)
  3. Specify an initializer list property for uuid, i.e. }) : uuid = uuid ?? const Uuid().v4();
  4. After all clients have migrated to use the uuid field, remove the final int id field

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants