JPOriginal post
Rank 1: Thread
I initially set up my Appwrite database to store user-inputted URLs as a URL type attribute. However, this has introduced some complications, and I now want to change the attribute type to String while validating it accordingly.
The challenge is that I already have several existing documents where the data is stored as a URL type. How can I safely convert the attribute to a String type without losing or corrupting the existing records? What would be the best approach to make this transition smoothly?
Summary
Developers want to switch a URL attribute to a String in Appwrite without losing existing data. To do this safely:
1. Create a new String attribute.
2. Update your app to write both URL and String attributes for new data.
3. Develop a script to migrate existing URL data to the new String attribute.
4. Update your app to use the new String attribute.
5. Ensure validation for URL format continues on new entries.