Consequences of renaming a column?
Additionally, the warning mentions "A manual migration may be required to prevent data loss." What does this manual migration entail?
Kindly,
Marianna
Comments
-
Yes, renaming your column will result in data loss at this time. That's something we do want to improve upon.
Additionally, yes renaming your column will mean in your APIs anything referencing the old column name will need to be updated. -
a workaround would be to create a new column, then create a function that queries all records and copies the value into the other column, and then remove the previous column. You still will need to update your APIs. Changing column names definitely is not something that should be done lightly as it has a snowball effect with required changes.
We 100% can do better by copying the data for you which we plan on doing, but I don't see an easy way to update the API - that still seems like it would be manual. -
and - Thanks for clarifying! Glad I didn't go ahead and change the name! I can figure out a work around. Thanks!
-
Hi I am new to the community and new to building apps.
I was wondering if there has been any updates regarding this matter.
Since I am still playing around with the database and trying to find the best structure and configuration, I am not able to foresee the consequences I may or may not have with the initial naming of columns.
This slows down the trial and error process and I would like to focus on how I would like to use my DB and the logic behind it, and I don't want the name of the column to be an obstacle, especially when I am trying to handle 150+ columns and tens of thousands of rows.
I am still very new to databases but I am also currently using Airtable. If I do not want to be troubled by the column names do you think it would be a good option to use Airtable? I would like to make use of the Object type column for complicated data so I would love to be able to change column names.
Thank you for any support!
-
usually only developers will ever see real column names, on frontend or in app you present your data whatever you want.
If its crucial to rename column, or more likely to change column type and keep data - make a new column of desired name, type and settings and then use a function to copy data from old_column to new_column.
i was also seriously bothered by this when started using Xano, but realization of fact 1, and as consequence - realization that i will need such thing rarely or never, gave me peace of mind. -
Hi Max!
Thank you for your kind response. Now I have been diving for a few days, and I'm starting to understand what you mean! It's less bothering as I get to know more about Xano. I'll try not to be anxious about the small things and keep an eye on the big picture!
Thanks again!
-
For the ones looking for a workaround for that, you can find below a basic, step-by-step tutorial on how to create a new column under your desired name and transfer the data from the old column to this new one. This way, you can effectively retain the column under its new name.
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback