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

Migrations support #8

Open
rafwell opened this issue Dec 1, 2023 · 3 comments
Open

Migrations support #8

rafwell opened this issue Dec 1, 2023 · 3 comments
Labels
question Further information is requested

Comments

@rafwell
Copy link

rafwell commented Dec 1, 2023

Hi!

This package support migrations implementation? I did a test here but the new columns who I've added aren't pulled then sync.

@nathanheffley
Copy link
Owner

Did you update your model's $watermelonAttributes?

class Task extends Model
{
    use SoftDeletes, Watermelon;

    protected array $watermelonAttributes = [
        'content',
        'is_completed',
    ];
}

@nathanheffley nathanheffley added the question Further information is requested label Dec 3, 2023
@rafwell
Copy link
Author

rafwell commented Jan 29, 2024

Hi!

Yes. I think it really was missing in this package. Take a look on my implementation: rafwell@01dd6bf

I'm basing on this https://watermelondb.dev/docs/Sync/Backend#implementing-pull-endpoint who said 6. If migration is not null, you MUST include records needed to get a consistent view after a local database migration
Now i'm getting the new columns when columns has change by migration. I think the same must be did for new tables, if you like I can do it via PR.

@nathanheffley
Copy link
Owner

Ohhh yes I see. Yes if you opened a PR that would be fantastic. Would you also be able to add a feature test where it demonstrates pulling records when there is a column that has been migrated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants