Skip to content

Auto align old records to new schemas as they are accessed #51313

Open

Description

@raisedadead

We have a forever-changing schema when it comes to the User record. It would be awesome to automatically update an older record to a newer schema as the request endpoint accesses them.

Something like the /get-session-user is a great place to fit this in.

That way we do not have to worry about backward compatibility and the records that are most frequently accessed would "be up to date".

This sounds easier than done, so some research and a smart strategy would be nice to have.

Prisma does not support MongoDB migrations: https://www.prisma.io/docs/concepts/database-connectors/mongodb#no-support-for-prisma-migrate

Activity

  1. converted this from a draft issue on Aug 17, 2023
  2. added this to the Backend API MVP milestone on Aug 17, 2023
  3. added
    platform: api
    on Aug 18, 2023
  4. naomi-lgbt commented on Aug 28, 2023

    @naomi-lgbt
    Member

    In theory, we could compare the user record to the default user to check for properties/types, add missing properties, remove properties that are on the record but not the default.

  5. ojeytonwilliams commented on Jun 12, 2024

    @ojeytonwilliams
    Contributor

    Since we're planning to run the normalization script after deployment, I think this can be deferred as well.

  6. added
    status: on the roadmap
    on Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform: apistatus: on the roadmap

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions