Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove id attribute from canvas attributes #30736

Merged
merged 10 commits into from
Feb 14, 2019
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
"type": "canvas-workpad",
"updated_at": "2018-10-22T15:19:02.081Z",
"version": 1,
"migrationVersion": {},
"migrationVersion": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since I don't know what this is used for, I might as well ask... what is this used for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to indicate to the migrator what version the data is migrated up to. Having {} indicates that the system needs to run all the canvas-workpad migrations when creating the record. Having 7.0.0 value here indicates to the migrator that the record is migrated up to version 7.0.0.

In this scenario the migrator won't need to run any migrations since the id field is already removed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, but it allows us to have, for example, an 8.0.0 migration in the future, and it would only run that since it knows it's already on 7.0.0. That's neat, thanks for the explanation!

"canvas-workpad": "7.0.0"
},
"attributes": {
"name": "[eCommerce] Revenue Tracking",
"id": "workpad-e08b9bdb-ec14-4339-94c4-063bddfd610e",
"width": 1080,
"height": 720,
"page": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
"type": "canvas-workpad",
"updated_at": "2018-10-22T14:17:04.040Z",
"version": 1,
"migrationVersion": {},
"migrationVersion": {
"canvas-workpad": "7.0.0"
},
"attributes": {
"name": "[Flights] Overview",
"id": "workpad-a474e74b-aedc-47c3-894a-db77e62c41e0",
"width": 1280,
"height": 720,
"page": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
"type": "canvas-workpad",
"updated_at": "2018-10-22T12:41:57.071Z",
"version": 1,
"migrationVersion": {},
"migrationVersion": {
"canvas-workpad": "7.0.0"
},
"attributes": {
"name": "[Logs] Web Traffic",
"id": "workpad-5563cc40-5760-4afe-bf33-9da72fac53b7",
"width": 1280,
"height": 720,
"page": 0,
Expand Down