Giter Club home page Giter Club logo

Comments (3)

charlesBochet avatar charlesBochet commented on August 18, 2024

Discuss with @ijreilly before tackling this one

from twenty.

gitstart-app avatar gitstart-app commented on August 18, 2024

Here is the GitStart Ticket for this issue: https://clients.gitstart.com/twenty/5449/tickets/TWNTY-6260

from twenty.

ijreilly avatar ijreilly commented on August 18, 2024

Some technical hints here -

Currently we have fields of type Phone that can be used for customized fields, and a standard field of type Text called "phone" on the standard object "person". We need to migrate both the Phone type custom fields and the phone standard field to the new Phones type.

I would recommend first tackling #6261 to get familiar with the issue

  1. (PR 1) Introduce new “Phones” composite field type (similar to “Links”)
    After this step is merged it is no longer possible to create custom field with the “old” phone type, but they are still part of the created standard fields, are still displaying correctly etc.
  • Create the new field type (FieldMetadataType.Phones)
  • Handle field display (inspiration: LinksFieldDisplay)
  • Handle field update (inspiration: LinksFieldInput). inputted value (ex: +33601020304) should be stored as the phone number while the countryCode should be inferred from input using the lib react-phone-number-input that we use for the current phone field input.
  • Prevent creation of new fields with "Phone" type (example PR)
  • To test: reset of db, creation of a new workspace, creation and filling of phones...
  1. (PR 2) Update standard fields of type "Phone" to the new type
    After this step is merged, newly created workspaces will directly benefit from the new type, while the existing workspaces need to have their migration to the new type done before they can have their metadata synchronized again; so this should only be merged and deployed when we are ready to do the migrations (step 3).
  • Update standard objects' standard phone fields of type Phone. I think you only need to update person's email field here, updating type from Text to Phones. (example PR)
  1. (PR 2 - same as step 2) Write script to replace "phone" fields with "phones" fields, handling the data migration
    After this step is merged, we can run the command on all active workspaces to migrate their data (twenty team will take care of running the command).
  • Example migration script - full PR. In addition here you need to migrate the standard phone field on person from type Text to Phones.
  • We want to migrate the current value of phone field to the new fields' phones.primaryPhone. countryCode has to be backfilled.
  • This type of command is now usually added to a group of commands that need to be run to allow for the upgrade to a new version of twenty, eg upgrade:0-23. You can probably add this to a future 0.24 command as this will not be ready by the time we release 0.23. For instance for 0.23 the command to run is yarn command:prod upgrade-0.23
  • To test: migration of data, sync-metadata on migrated workspaces (command yarn command:prod workspace:sync-metadata), running command multiple times of the same workspace that initially required a migration, running command simulating errors to ensure rollback is working correctly

from twenty.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.