laravel-watermelon
laravel-watermelon copied to clipboard
Migrations support
Hi!
This package support migrations implementation? I did a test here but the new columns who I've added aren't pulled then sync.
Did you update your model's $watermelonAttributes
?
class Task extends Model
{
use SoftDeletes, Watermelon;
protected array $watermelonAttributes = [
'content',
'is_completed',
];
}
Hi!
Yes. I think it really was missing in this package. Take a look on my implementation: https://github.com/rafwell/laravel-watermelon/commit/01dd6bf38be0ada2524e116cdd0912434f4e2f0f
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.
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?