Comments (3)
Discuss with @ijreilly before tackling this one
from twenty.
Here is the GitStart Ticket for this issue: https://clients.gitstart.com/twenty/5449/tickets/TWNTY-6260
from twenty.
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
- (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...
- (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)
- (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)
- [Workflow] I can execute a basic workflow
- [Workflow] I can run a workflow manually
- [Workflow] I can add a record mutation as an action
- [Workflow] I can execute a record mutation as an action
- [Workflow] When I receive a nest event, I trigger WorkflowEventJob
- Sporadic & Unusual Log-Outs While Active (Token Expired)
- Add box-shadow on column freeze
- Prevent contributors from opening a PR on a main branch of their fork HOT 1
- Fix total count in show page navigation bar when total count = 1 HOT 3
- Inconsistent behavior in record navigation HOT 7
- Explain Privacy of File Uploads
- Update yarn start command and doc for worker
- Redis cache store cannot be password protected HOT 2
- Enable Filtering by Sub-fields in Composite Fields HOT 6
- Clicking on the support dropdown immediately opens the support chat. HOT 5
- Remove all raw queries from the messaging and calendar modules
- Create new column activationStatus inside workspace table
- Recurring error "Record field type not supported : RELATION}"
- Add all TS files to front type checker. HOT 2
- Problem with Babel, wyw-in-js and Linaria with Storybook HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twenty.