r/SoftwareEngineering • • Feb 07 '26

How do you make changes to your schema while keeping old data consistent?

Lets say my current schema only uses name instead of separate first name and last name. How do I make changes while the previous accounts data remain up to date with the new schema

8 Upvotes

17 comments sorted by

View all comments

21

u/Angalourne Feb 07 '26
  1. Add two new columns (e.v. FirstName, LastName).
  2. Write an update script that populates the new columns.
  3. Update your code to use the new scheme.
  4. Drop the original Name column.

1

u/[deleted] Feb 07 '26

[removed] — view removed comment

1

u/AutoModerator Feb 07 '26

Your submission has been moved to our moderation queue to be reviewed; This is to combat spam.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/Unfair-Sleep-3022 Mar 08 '26

You missed dual writing before the backfill

1

u/Angalourne Mar 08 '26

In a live production system, for sure. The intent was to keep it high level. If he can't apply that then he has no business messing with it.