Nozbe / WatermelonDB

🍉 Reactive & asynchronous database for powerful React and React Native apps ⚡️
https://watermelondb.dev
MIT License
10.62k stars 600 forks source link

Add destroyColumn, renameColumn, and destroyTable migration steps #1799

Open skam22 opened 5 months ago

skam22 commented 5 months ago

This PR implements most of the outstanding code changes from

https://github.com/Nozbe/WatermelonDB/pull/1671 and https://github.com/Nozbe/WatermelonDB/pull/1654.

In addition to resolving those conflicts it has a few minor syntactic / grammatical fixes to match the existing migration approaches.

skam22 commented 5 months ago

added destroy table migration step as well

radex commented 5 months ago

@skam22 Thank you for your contribution! I'm seeing some issues, and I'd like to have this feature finished and shipped, so I took the liberty to add more commits to your PR. Thanks!

skam22 commented 5 months ago

ok let me know if you need help with anything.

KrisLau commented 5 months ago

Somewhat related to this PR but it would be nice to be able to reset the entire db (schema, lastPulledAt and all) during/instead of migrations as well so that the backend can be the main source of data and migrations can be simplified for apps that don't require the full offline functionality. I created an issue to ask about it awhile back: https://github.com/Nozbe/WatermelonDB/issues/1609

skam22 commented 4 months ago

@radex resolved conflicts

skam22 commented 4 months ago

@radex fwiw I was able to run the tests locally with success by changing the iPhone model to 15 instead of 14 (as is required for Xcode 15.4).

scripts/test-ios

#!/bin/bash

set -x
set -e

xcodebuild -workspace native/iosTest/WatermelonTester.xcworkspace -scheme 'WatermelonTester' -destination 'name=iPhone 15' test